You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function identifies a severe memory leak in the GetPixelBytes function during execution. A useful insight is that my code frequently creates and destructs RenderTarget instances, which may contribute to the issue.
The text was updated successfully, but these errors were encountered:
private async void DisplayMap() { var renderPixel = _drawingManager.GetTarget().GetPixelBytes(); // 获取渲染目标 using (var image = SoftwareBitmap.CreateCopyFromBuffer(renderPixel.AsBuffer(), BitmapPixelFormat.Bgra8, _canvasWidth, _canvasHeight, BitmapAlphaMode.Premultiplied)) // 创建软件位图 { var source = new SoftwareBitmapSource(); // 创建软件位图源 await source.SetBitmapAsync(image); // 异步设置位图 ImageBox.Source = source; // 设置图像框的源 } renderPixel= null; // 释放渲染目标 }
This function identifies a severe memory leak in the GetPixelBytes function during execution. A useful insight is that my code frequently creates and destructs RenderTarget instances, which may contribute to the issue.
The text was updated successfully, but these errors were encountered: