erasing, redrawing NSBezierPath into and NSImage problem
erasing, redrawing NSBezierPath into and NSImage problem
- Subject: erasing, redrawing NSBezierPath into and NSImage problem
- From: Wilhelm Phillips <email@hidden>
- Date: Mon, 5 Jul 2004 18:32:18 -0700
Hi Everyone:
There is probably a really simple answer to this question, but it's
been driving me nuts.
I've drawn bezier paths into several images using different color fills
to create labels to be used in a labelMatrix. The bezier path
calculations are based on the cell height and width of my labelMatrix.
Upon launching my application, all the labels draw correctly.
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.
When I log the new image size and bezier coordinates upon resizing the
labelMatrix, the numbers are correct (i.e. if the cell width is 150,
then the image width has been updated to 150 and the largest x
coordinate has been updated 150). However, the image never gets
updated in the labelMatrix. And I have setNeedsDisplay on labelMatrix.
The routine that attempts to redraw the images is call on
windowDidResize and various other routines in my application rely on
this with success.
There must be something fundamental that I am missing on this. I have
scoured this developer list and tried every bit of code related to
drawing into an image, as well as different approaches to achieving my
desired results, but can't find anything significant on how to erase my
NSImage before I redraw them.
I thought that going the route of drawing an NSBezierPath into an
NSImage would be efficient for creating custom shapes to be used in an
NSMatrix with setImage. Perhaps there is a better way to approach
this.
Should I be going to route of modifying the existing bezier paths
within the images? NSAffineTransform?
Any ideas?
Thanks,
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.