public override void DrawMapRect(MKMapRect mapRect, nfloat zoomScale, CGContext context) { SKMapSpan rectSpan = mapRect.ToMapSpan(); if (_SharedOverlay.IsVisible && rectSpan.FastIntersects(_SharedOverlay.GpsBounds)) { CGRect coreDrawRect = RectForMapRect(mapRect); SKBitmap drawBitmap = GetOverlayBitmap(); SKMapCanvas mapCanvas = new SKMapCanvas(drawBitmap, mapRect.ToRectangle(), zoomScale, true); _SharedOverlay.DrawOnMap(mapCanvas, rectSpan, zoomScale); Console.WriteLine($"Drawing tile for zoom scale {zoomScale} with GPS bounds {mapRect} and Mercator {mapRect.ToRectangle()}"); context.DrawImage(coreDrawRect, drawBitmap.ToCGImage()); // Let's exit this method so MapKit renders to screen while we free our resources in the background. Task.Run(() => ReleaseOverlayBitmap(drawBitmap)); } }
public static NSImage ToNSImage(this SKBitmap skiaBitmap) { var cgImage = skiaBitmap.ToCGImage(); return(new NSImage(cgImage, CGSize.Empty)); }
public static CIImage ToCIImage(this SKBitmap skiaBitmap) { return(skiaBitmap.ToCGImage()); }
public static UIImage ToUIImage(this SKBitmap skiaBitmap) { var cgImage = skiaBitmap.ToCGImage(); return(new UIImage(cgImage)); }
public static UIImage ToUIImage(this SKBitmap skiaBitmap, nfloat scale, UIImageOrientation orientation) { var cgImage = skiaBitmap.ToCGImage(); return(new UIImage(cgImage, scale, orientation)); }