Re: NSBezierPath to NSImage?
Re: NSBezierPath to NSImage?
- Subject: Re: NSBezierPath to NSImage?
- From: Matthew Smith <email@hidden>
- Date: Wed, 01 May 2002 09:19:27 +1000
>
Here's an except of my code:
>
>
theImage = [[NSImage alloc] initWithSize:NSMakeSize(theSize, theSize)];
>
>
[theImage lockFocus];
>
[self drawShape]; // bezier path drawing routines
>
[theImage unlockFocus];
Hello,
I'm bugging the list about NSBezierPath and flood filling, and while I wait
for an answer I'll tell you what I know:
Are you setting a colour?
NSColor myColour = [NSColor blackColor];
[myColour set];
How are you drawing your paths?
[theImage lockFocus];
[[NSBezierPath bezierPathWithRect: NSMakeRect(x, y, width, height)] stroke];
[NSBezierPath strokeLineFromPoint: point1 toPoint: point2];
[[NSBezierPath bezierPathWithOvalInRect: NSMakeRect(x, y, width, height)]
fill];
[theImage unlockFocus];
This sort of thing works for me...
Incidentally, if you don't lock the focus cocoa seems to draw on the last
updated NSView, which can have interesting results ;)
_______________________________________________
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.