Re: Erasing portion of NSView and custom cursors
Re: Erasing portion of NSView and custom cursors
- Subject: Re: Erasing portion of NSView and custom cursors
- From: Andrew Farmer <email@hidden>
- Date: Thu, 3 Feb 2005 16:13:40 -0800
On 3 Feb 2005, at 15:38, Austin Sarner wrote:
I currently have an NSView that the user can draw on. Every time the
color or thickness is changed, a new bezier path is created. In
drawRect I enumerate through the array of paths and draw them. Is
there any relatively simple way to have an 'eraser' path? I.E. one
that will clear everything it covers when the user draws over
something with it. The view does not have a white background, so
simply making it draw white is not an option. Thanks a bunch for any
help.
There may be, but it sounds like you're going about things the wrong
way. You're implementing what sounds like a "paint" program; however,
you need to decide whether you're going to use bitmapped graphics (in
which case you should be rendering directly into an image, not into an
array of BezierPaths) or vector graphics (in which case one usually
doesn't have an "eraser" tool).
Flash does have an eraser tool, but it actually splits paths where it's
used, which would be extremely difficult to implement correctly.
The second, is there any simple way to change the cursor to a
specified tiff image when over a view?
Read the documentation for NSCursor.
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden