Re: How to convert an NSBezierPath to an NSImage?
Re: How to convert an NSBezierPath to an NSImage?
- Subject: Re: How to convert an NSBezierPath to an NSImage?
- From: Janek Priimann <email@hidden>
- Date: Fri, 11 Apr 2003 20:39:51 +0300
>
Hi,
>
>
I am working on a little animation that moves different NSImage objects
>
in a view. I have some other drawings made with NSBezierPath, and I
>
would like to make NSImage of them to display them in my view with the
>
other images. Is that possible?
>
>
Thanks in advance,
>
>
-- Arthur
Use the NSImage lockFocus/unlockFocus mechanism.
NSImage *myImage = [[NSImage allocWithZone:NULL] initWithSize:NSMakeSize(width, height)];
[myImage lockFocus];
// Draw(fill, stroke, clip) your bezier paths here
[myImage unlockFocus];
Links:
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSImage.html#lockFocus
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSImage.html#unlockFocus
-----------------------------------------
Hot Mobiil - helinad, logod ja piltsunumid!
http://portal.hot.ee
_______________________________________________
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.