Re: Strange issue with PNG files
Avi Drissman <avi-wYYLmqtpiAJWk0Htik3J/[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
If by "state" you mean at ppi != 72, yes. Images come in all resolutions (assuming they have resolution at all (e.g. pdf)). You can draw it at its natural size, at a size that makes it come out pixel-for-pixel (build the NSSize, etc.) or anything in-between. BTW, don't forget that an NSImage can have multiple representations, each with a different pixel size (load an ICNS to see that). In that case, your concept of "this state" isn't even meaningful. Images are much more than a bag of pixels. Avi On Thu, Mar 4, 2010 at 2:23 PM, Eric Gorr <[email protected]> wrote: > On Mar 4, 2010, at 2:06 PM, Avi Drissman wrote: > > > It's apparently not a 72ppi picture. Even though the image is 16x14 > pixels, at ~200ppi something 14 pixels high is only 5 points high. > > > > You are getting the full image, and I bet if you took the NSImageRep and > asked it for -pixelsHigh or -pixelsWide you'd get the 14 and 16. > > Yes, that is true. > > > If you want to draw it pixel for pixel despite the high ppi, use > -pixelsHigh/-pixelsWide, create an NSSize of that size, and draw it > "scaled". > > So, the only/recommended way to determine when an image is in this state is > to compare what [image size] returns vs. pixelsHeight & pixelsWide? > > > _______________________________________________ > MacOSX-dev mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/macosx-dev >