mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-01 18:23:32 +00:00
Merge pull request #503 from diogotr7/fix-debug-bitmap
Fixed an AccessViolationException when moving devices in the surface
This commit is contained in:
commit
af52f467df
@ -55,7 +55,11 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
|||||||
if (e.BitmapBrush?.Bitmap == null || e.BitmapBrush.Bitmap.Pixels.Length == 0)
|
if (e.BitmapBrush?.Bitmap == null || e.BitmapBrush.Bitmap.Pixels.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(CurrentFrame is WriteableBitmap writeableBitmap))
|
var bitmapInfo = e.BitmapBrush.Bitmap.Info;
|
||||||
|
|
||||||
|
if (!(CurrentFrame is WriteableBitmap writeableBitmap) ||
|
||||||
|
writeableBitmap.Width != bitmapInfo.Width ||
|
||||||
|
writeableBitmap.Height != bitmapInfo.Height)
|
||||||
{
|
{
|
||||||
CurrentFrame = e.BitmapBrush.Bitmap.ToWriteableBitmap();
|
CurrentFrame = e.BitmapBrush.Bitmap.ToWriteableBitmap();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user