• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to detect a Retina Mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to detect a Retina Mac (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to detect a Retina Mac (From: Tom Davie <email@hidden>)
 >Re: How to detect a Retina Mac (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to detect a Retina Mac (From: Tom Davie <email@hidden>)
 >Re: How to detect a Retina Mac (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to detect a Retina Mac (From: Marcel Weiher <email@hidden>)
 >Re: How to detect a Retina Mac (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: How to detect a Retina Mac
  • Next by Date: Re: How to detect a Retina Mac
  • Previous by thread: Re: How to detect a Retina Mac
  • Next by thread: Re: How to detect a Retina Mac
  • Index(es):
    • Date
    • Thread