Re: erasing, redrawing NSBezierPath into and NSImage problem
Re: erasing, redrawing NSBezierPath into and NSImage problem
- Subject: Re: erasing, redrawing NSBezierPath into and NSImage problem
- From: "Louis C. Sacha" <email@hidden>
- Date: Mon, 5 Jul 2004 20:07:19 -0700
Hello...
Have you tried using NSRectFill() to erase the image?
After you lock focus on your image, use the NSRectFill() function to
fill it with the "clear" color (uses the NSCompositeCopy compositing
mode, which replaces the pixels with the new color).
NSRect imageRect;
imageRect.origin = (NSPoint){0.0f,0.0f};
imageRect.size = [yourImage size];
[[NSColor clearColor] set];
NSRectFill(imageRect);
Hope that helps,
Louis
When I resize the labelMatrix I want to resize/redraw these images.
So, I want to clear the existing label images and draw a new
correctly sized bezier path into them. This is my problem: I
cannot find a way to clear the existing label images before I draw
into them again. The images cannot be released because they are
still being used by labelMatrix. I have managed to add to the
existing images by drawing additional paths into them, but every
attempt to clear the images first fails.
...
Will
_______________________________________________
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.