Re: How can I use CGrafPtr value?
Re: How can I use CGrafPtr value?
- Subject: Re: How can I use CGrafPtr value?
- From: Uli Kusterer <email@hidden>
- Date: Sun, 5 Mar 2006 07:15:37 +0100
On 05.03.2006, at 05:49, 이종웅 wrote:
how can I use CGrafPtr in my cocoa app?
Check out the Quickdraw docs. CGrafPtr is a pointer to a Quickdraw
graphics port. Basically, what I'd do is open a CGContextRef for the
CGrafPtr, and then use CoreGraphics to draw in that, but I think
there's also a way to get a Cocoa NSGraphicsContext for a
CGContextRef (at least if you're running Tiger), then you could use
NSGraphicsContext on that.
Alternatively, you could do your Cocoa drawings into an NSImage,
and then copy the contents of that image into the CGrafPort. To do
that, you'd lock focus on the image, call -graphicsPort on the
current graphics context (this gets you a CGContextRef) and then you
can get a CGrafPort for that context and use e.g. Quickdraw's
CopyBits call to copy the drawings from one port to the other.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden