سؤال

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

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top