Change CGImageDestination dpi

809 views Asked by At

I know how to change the dpi of a NSImageRep, but I can't figure out how to make CGImage APIs reflect this change... Is there a way to make CGImage write a file which is NOT a standard 72dpi? If I set a NSImageRep to be 144dpi, when I write it to file using CGImage APIs I always obtain a 72dpi image...

Thanks a lot

1

There are 1 answers

1
omz On BEST ANSWER

When you add an image to your destination with CGImageDestinationAddImage, you can pass a dictionary as the properties parameter. For this dictionary you can use all the keys specified in the CGImageProperties Reference, specifically kCGImagePropertyDPIWidth and kCGImagePropertyDPIHeight.