Re: How to detect a Retina Mac
Re: How to detect a Retina Mac
- Subject: Re: How to detect a Retina Mac
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 19 Aug 2013 17:56:19 +0700
On 19 Aug 2013, at 17:35, Graham Cox <email@hidden> wrote:
>
> On 19/08/2013, at 12:05 PM, Gerriet M. Denkmann <email@hidden> wrote:
>
>> Here is the final code (if there is anything wrong or not quite right, please feel free to critizise it):
>
>> [NSGraphicsContext setCurrentContext: bitmapContext2 ];
>
>
> You might want to save and restore the current graphics context around the whole thing so that you don't leave it set to your bitmap. It may well be harmless, but always better to play nice.
Good idea. I added:
NSGraphicsContext *originalContext = [NSGraphicsContext currentContext];
... do stuff ...
[NSGraphicsContext setCurrentContext: originalContext ];
I had indeed some (non-reproducible) error messages, which may very well be the result of this omission:
[...]: _initWithWindowNumber: error creating graphics ctxt object for ctxt:0x30917, window:0xffffffff
Thanks a lot for pointing this out!
Kind regards,
Gerriet.
_______________________________________________
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