Re: NSBezierPath to NSImage?
Re: NSBezierPath to NSImage?
- Subject: Re: NSBezierPath to NSImage?
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 30 Apr 2002 14:42:56 -0700
On Monday, April 29, 2002, at 08:45 PM, Michael Briscoe wrote:
Hello List!
This is probably a stupid question, but it's driving me nuts!
Is there a way to draw NSBezierPath's directly to an NSImage?
Of course.
I need this so that I can render the NSBezierPath data as a
bitmap, and use composite operations in my NSView.
Here's an except of my code:
theImage = [[NSImage alloc] initWithSize:NSMakeSize(theSize, theSize)];
[theImage lockFocus];
[self drawShape]; // bezier path drawing routines
[theImage unlockFocus];
This doesn't seem to be working.
You're not showing us enough code here to see what's going
wrong. What does -drawShape do? Are you sure that your path
lies entirely within the borders of the image? What's the
current color when you stroke or fill the path? What's the
background color, etc?
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.