• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: mouse drag feedback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: NSDictionary Palette available -- addendum
  • Next by Date: Re: NSDictionary Palette available -- addendum
  • Previous by thread: Re: mouse drag feedback
  • Next by thread: Terminating app when threads are running
  • Index(es):
    • Date
    • Thread