I'm working on a photo app that needs to save images with user specified properties such as number of inches across the long edge at a specific resolution, say 400dpi or whatever the user specifies. So, I need to write out a CGImage with the ability to set image dimensions, resolution, colorspace, etc. I haven't yet found a way to do this at the CGImage level. I'm currently using the iOS port of ImageMagick and as amazing as it is, I'd like to use methods intrinsic to iOS.
Any help would be greatly appreciated....
CGImage
is an immutable, opaque, in memory image representation.
I believe what you are looking for instead is the Image I/O functionalities, located in the aptly titled ImageIO.framework
. Create a CGImageDestination
, then specify its properties using CGImageDestinationSetProperties
.