public static SKBitmap ToSKBitmap(this CGImage cgImage) { var info = new SKImageInfo((int)cgImage.Width, (int)cgImage.Height); var bitmap = new SKBitmap(info); using (var pixmap = bitmap.PeekPixels()) { cgImage.ToSKPixmap(pixmap); } return(bitmap); }
public static SKImage ToSKImage(this CGImage cgImage) { var info = new SKImageInfo((int)cgImage.Width, (int)cgImage.Height); var image = SKImage.Create(info); using (var pixmap = image.PeekPixels()) { cgImage.ToSKPixmap(pixmap); } return(image); }