我创建一个WriteableBitmap
对象,画一条线并尝试将其设置为Image
控件的源。由于某种原因,当我尝试设置源时,程序停止响应并在 5 秒后关闭。有人知道出了什么问题吗?(我也在使用 WriteableBitmapEx)
WriteableBitmap bit = new WriteableBitmap(400, 400, 96, 96, PixelFormats.Bgr32, null);
WriteableBitmapExtensions.DrawLine(bit, 10, 10, 300, 300, Core.PrimaryColor.ColorValue);
ImageCanvas.Source = bit; // Sets the image to our bitmap, but program crashes for some reason!