Re: mouse drag feedback
Re: mouse drag feedback
- Subject: Re: mouse drag feedback
- From: email@hidden
- Date: Sat, 16 Mar 2002 01:19:14 -0800
I don't know about one call, and frankly I'm remembering this from the
one-bit-grayscale OS 6 days (yes, I said 6), but the trick for drawing
ants used to be to set the pen pattern to a pattern that had thick
black diagonal stripes. Using this pattern, a rectangle drawn with a
pen width of 1 would show up as a dashed line. You could make the
"ants" appear to march around the rectangle by changing the pen pattern
to a slightly different one with the diagonal lines offset a bit. By
using XOR to draw the rectangle, you could smoothly resize it as the
user dragged the mouse.
Hmm. Well, using either a pattern (+[NSColor colorWithPatternImage:])
or a line dash (-[NSBezierPath setLineDash:count:phase:) you ought to be
able to get a similar effect. You can't really do XOR any more, but
with the way things are double-buffered now, you don't really need to
anyway. If redrawing your content from your model is too slow, then
cache an image of the bits you're going to obscure with -[NSWindow
cacheImageInRect:], or by doing it yourself with -[NSBitmapImageRep
initWithFocusedViewRect:]. Shouldn't be significantly harder than what
I hear you describing...
Ben Haller
Stick Software
_______________________________________________
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.