Re: CGImageSourceCopyPropertiesAtIndex returns nil?
Re: CGImageSourceCopyPropertiesAtIndex returns nil?
- Subject: Re: CGImageSourceCopyPropertiesAtIndex returns nil?
- From: Scott Thompson <email@hidden>
- Date: Thu, 27 Oct 2005 11:12:38 -0500
On Oct 27, 2005, at 3:46 AM, Steve Gehrman wrote:
I'm trying to get the properties of an .ai image.
CGImageSourceCopyPropertiesAtIndex returns nil.
But, If I create an NSImage, I can get the size. Why doesn't
CGImageSourceCopyPropertiesAtIndex return a
kCGImagePropertyPixelWidth and kCGImagePropertyPixelHeight?
Because a ".ai" image is simply a PDF. PDF's are drawn in a device
independent drawing space and don't have an intrinsic "pixel" size.
The pdf does not receive it's pixel size until you draw it on a
context and Quartz transfers the drawing to a device that does have
pixels.
I suspect that when you create an NSImage from it, NSImage is making
the assumption that the image will be drawn to a 72 dpi (screen
resolution) device and it is returning a size based on that
assumption. If you were to draw that image to a 300 dpi laser
printer, however, you pixel counts would be wrong.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden