• 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 do I get a CGContextRef?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get a CGContextRef?


  • Subject: Re: How do I get a CGContextRef?
  • From: Roland King <email@hidden>
  • Date: Sun, 23 Nov 2008 10:43:18 +0800

well where are you calling it?

That's the correct function, but only works when there is a graphics context set, and that's only inside drawRect: in a UIView.

I wandered through the documentation a little and got reasonably lost, it does talk about NSGraphicsContext in there, but remember a lot of the documentation was dragged over from OS X and some of the stuff in there doesn't exist on iPhone, NSGraphicsContext is one of them. I don't see any way to create one for the iPhone window, you can create bitmap ones I suspect, I think you need to be in drawRect:, but then again, if you're not, why do you want one?

I'm going to have to dive into the whole quartz and drawing code one day as I suspect there is a lot of great stuff down there .. but it's daunting.

On Nov 23, 2008, at 9:48 AM, DKJ wrote:

On 22-Nov-08, at 17:40 , Ken Ferry wrote:
Take a look here:


Thanks for the reference, but I'm doing this for iPhone, and the procedure seems to be different. The compiler doesn't recognise the NSGraphicsContext class. I tried using the UIGraphicsGetCurrentContext function, but that doesn't work either: I get an "invalid context" error when I use it in CGContextStrokeRect.

dkj



_______________________________________________

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

_______________________________________________

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 do I get a CGContextRef? (From: DKJ <email@hidden>)
 >Re: How do I get a CGContextRef? (From: "Ken Ferry" <email@hidden>)
 >Re: How do I get a CGContextRef? (From: DKJ <email@hidden>)

  • Prev by Date: Re: NSPopupUpButton not showing checked menu items
  • Next by Date: Re: Facile Core Data Question
  • Previous by thread: Re: How do I get a CGContextRef?
  • Next by thread: Re: How do I get a CGContextRef?
  • Index(es):
    • Date
    • Thread