1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Fixed an AccessViolationException when moving devices in the surface

This commit is contained in:
Diogo Trindade 2020-11-15 19:42:33 +00:00
parent 969e0d3e82
commit 563e36930f

View File

@ -55,7 +55,11 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
if (e.BitmapBrush?.Bitmap == null || e.BitmapBrush.Bitmap.Pixels.Length == 0)
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();
return;