Re: drawRect: wrong scale in a programmatically created window
Re: drawRect: wrong scale in a programmatically created window
- Subject: Re: drawRect: wrong scale in a programmatically created window
- From: Quincey Morris <email@hidden>
- Date: Fri, 15 Jan 2016 11:40:01 -0800
- Feedback-id: 167118m:167118agrif8a:167118sOj-s-pjNg:SMTPCORP
On Jan 15, 2016, at 11:24 , Andreas Höschler <email@hidden> wrote:
>
> However, I generated the image rep with a 851 x 899 view and wrote it into a PNG file (code in earlier mail).
Yes, I saw, but you didn’t include (or I couldn't find) the log output that showed the size of the NSImage object, even though you had a line of code to log it.
NSImage, when given image data that has A x B pixels and a PPI (pixels per inch) of C, may choose to ignore C, rather than use it to compute C x D points. It’s not clear whether this happened in your case or not.
It does this because PPI is often just wrong. The actual pixel dimensions are the only reliable numbers.
> When I open this PNG with Preview.app it appears much larger (probably the 1792 x 1798). The PNG occupies almost the complete height of my retina display screen. PNG attached!
>
> <A.png>
>
> So it seems that Preview.app when opening a PNGs takes pixels for points or who know what.
Same thing. Preview doesn’t believe any metadata about the image size. It just works with the pixels.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden