문제

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