diff --git a/src/Eto.Wpf/Drawing/BitmapHandler.cs b/src/Eto.Wpf/Drawing/BitmapHandler.cs index c7b94e4f9..76ba530ac 100755 --- a/src/Eto.Wpf/Drawing/BitmapHandler.cs +++ b/src/Eto.Wpf/Drawing/BitmapHandler.cs @@ -137,6 +137,8 @@ protected override void Initialize() public void SetBitmap(swmi.BitmapSource bitmap) { + if (bitmap is swmi.RenderTargetBitmap) + bitmap = new swmi.WriteableBitmap(bitmap); Control = bitmap; SetFrozen(); } diff --git a/src/Eto.Wpf/Drawing/CachedBitmapFrame.cs b/src/Eto.Wpf/Drawing/CachedBitmapFrame.cs old mode 100644 new mode 100755 index 828886d71..3ef98d94b --- a/src/Eto.Wpf/Drawing/CachedBitmapFrame.cs +++ b/src/Eto.Wpf/Drawing/CachedBitmapFrame.cs @@ -38,10 +38,11 @@ public swmi.BitmapFrame Get(swmi.BitmapSource image, float scale, int width, int // There's no way to get around it other than just not creating that many and using GC.Collect/WaitForPendingFinalizers. // we can't do it in Eto as it'd be a serious performance hit. var target = new swmi.RenderTargetBitmap(scaledwidth, scaledheight, 96 * scale, 96 * scale, swm.PixelFormats.Default); - target.Render(targetVisual); - target.Freeze(); + target.RenderWithCollect(targetVisual); + + var writable = new swmi.WriteableBitmap(target); - _cachedFrame = swmi.BitmapFrame.Create(target); + _cachedFrame = swmi.BitmapFrame.Create(writable); _cachedFrame.Freeze(); _scale = scale; _width = width;