One way to do this:
CGImageRef scaledImage(CGImageref, destination rect) { context = CGBitmapContextCreate(rect...); CGContextDrawImage(context, rect); return CGBitmapContextCreateImage(context) }
Questions:
Creating a raster context can be quite expensive if the image scaling operation is very frequent. Is there any other way to scale CGimage? Or is caching such a raster context for the zoom operation the only option?
source share