Re: How can I use CGrafPtr value?
Re: How can I use CGrafPtr value?
- Subject: Re: How can I use CGrafPtr value?
- From: Scott Thompson <email@hidden>
- Date: Sun, 5 Mar 2006 00:20:00 -0600
On Mar 4, 2006, at 10:49 PM, 이종웅 wrote:
hi,
I can get a CGrafPtr from brower plugin.
then I want to draw something by using this CGrafPtr value.
I heard CGrafPtr is the structure for Carbon windows(I have no
experience with Carbon).
but I can't use this value in my Cocoa app(I just start Cocoa).
how can I use CGrafPtr in my cocoa app?
I'm sorry I'm not good at English.
This was typed into mail, but you could try something like:
CGContextRef cgContext;
OSStatus err = QDBeginCGContext(yourCGrafPtr, &cgContext);
if(err == noErr)
{
[NSGraphicsContext saveGraphicsState];
// I don't know if the flipped paramter below should be true or false.
[NSGraphicsContext setCurrentContext: [NSGraphicsContext
graphicsContextWithGraphicsPort: cgContext flipped: NO];
/* draw here */
[NSGraphicsContext restoreGraphicsState];
QDEndCGContext(yourCGGrafPtr, &cgContext);
}
_______________________________________________
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