Skip navigation.
 
mllockFocus clearing current color
FROM : Jonathon Mah
DATE : Sat Apr 16 18:21:57 2005

Hi,

This feels like it should have a simple answer, but I've searched and
can't find anything. I'm trying to draw an NSBezierPath into an NSImage
with the current color. I can break it down to this case:

NSImage *myImage = [[NSImage alloc] initWithSize:[path bounds].size];
[myImage lockFocus];
[path fill];
[myImage unlockFocus];

The problem is that the path is filled with black instead of the
current drawing color (which was set just above). How can I maintain
that color when drawing into my image?

(I can't put [someColor set] immediately above [path fill], as the
color will be set somewhere, then this method will be called.)

Thanks,


Jonathon Mah
<email_removed>

Related mailsAuthorDate
mllockFocus clearing current color Jonathon Mah Apr 16, 18:21
mlRe: lockFocus clearing current color Ian was here Apr 16, 18:57
mlRe: lockFocus clearing current color Jonathon Mah Apr 16, 18:58
mlRe: lockFocus clearing current color Ian was here Apr 16, 19:01
mlRe: lockFocus clearing current color Jonathon Mah Apr 16, 19:04
mlRe: lockFocus clearing current color Matt Neuburg Apr 16, 19:10
mlRe: lockFocus clearing current color Jonathon Mah Apr 16, 19:19
mlRe: lockFocus clearing current color Jonathon Mah Apr 16, 20:10