Frage

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

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top