Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }