source/SkiaSharp.Views/SkiaSharp.Views.WPF/WPFExtensions.cs [85:92]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public static WriteableBitmap ToWriteableBitmap(this SKBitmap skiaBitmap) { using var pixmap = skiaBitmap.PeekPixels(); using var image = SKImage.FromPixels(pixmap); var wb = image.ToWriteableBitmap(); GC.KeepAlive(skiaBitmap); return wb; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - source/SkiaSharp.Views/SkiaSharp.Views.WinUI/UWPExtensions.cs [112:119]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public static WriteableBitmap ToWriteableBitmap(this SKBitmap skiaBitmap) { using var pixmap = skiaBitmap.PeekPixels(); using var image = SKImage.FromPixels(pixmap); var wb = image.ToWriteableBitmap(); GC.KeepAlive(skiaBitmap); return wb; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -