Re: How to detect a Retina Mac
Re: How to detect a Retina Mac
- Subject: Re: How to detect a Retina Mac
- From: Graham Cox <email@hidden>
- Date: Mon, 19 Aug 2013 09:20:08 +0200
On 19/08/2013, at 9:01 AM, Gerriet M. Denkmann <email@hidden> wrote:
> I seem to need a way to tell NSImage NOT to double the pixels for me, but I don't see any way to do this.
> Like: [ image setBackingScaleFactor: 1 ] but no such method seems to exist.
>
>
> So hardcoding the retina-ness of my current computer seems to be the only solution.
Of course it isn't.
Marcel's answer looks correct to me - forget NSImage, use NSBitmapImageRep instead (without adding it to an NSImage). Instead of -lockFocus, etc, just create a context using the bitmap rep and set it as the current context. Then you can draw using either high-level stuff that uses "the current context" or lower level CG... functions.
The problem you're running into is that NSImage is trying to be too darn smart. Don't give it the chance, by not using it AT ALL.
--Graham
_______________________________________________
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