Re: Basic NSGraphicsContext question
Re: Basic NSGraphicsContext question
- Subject: Re: Basic NSGraphicsContext question
- From: "Alastair J.Houghton" <email@hidden>
- Date: Fri, 4 Jul 2003 23:22:01 +0100
On Friday, July 4, 2003, at 09:36 pm, Jim Crafton wrote:
I think you probably want to look at the lockFocus and unlockFocus
methods of NSImage. Something like
NSImage *myImage = [[NSImage alloc] initWithSize:NSMakeSize(width,
height)];
[myImage lockFocus];
// Draw here
[myImage unlockFocus];
will get you an NSImage that you can render to the window using the
various compositing and/or drawing methods.
Is it possible to get the NSGraphicsContext that the NSImage uses ?
Try [NSGraphicsContext currentContext] between the
lockFocus/unlockFocus.
But why do you need an NSGraphicsContext? You don't normally need to
get at the context itself (again, unlike on Win32).
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.