• 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: RgnHandle replacement?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RgnHandle replacement?


  • Subject: Re: RgnHandle replacement?
  • From: Scott Anguish <email@hidden>
  • Date: Thu, 7 Nov 2002 02:01:43 -0500

So, draw that intersected area of the icon into an NSImage that is 1x1
(scale it) and then see if that single pixel is on.. you'd want to make
sure that anti-aliasing is off when you do this..

Hmm. That might work well I think. Cool!

Just wish there was a NSRegion class though so I wouldn't have to worry
about this stuff. NSBezierPath doesn't cut the mustard sometimes.

Well, think of it as implementing your own.. Then you could share it.. :-)

This could actually be done on a category on NSImage -(BOOL)imagePixelsIntersectRect:(NSRect)theRect.. you might need to play with the transfer mode, depending on if your original images have a white background, or alpha...

I can't remember how regions used to implement this kind of thing, it may have been undefined... regions could also be way over used too (I'm positive I was guilty of that in at least a few cases, since one of my apps did massive amounts of hit testing... )
_______________________________________________
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.
References: 
 >Re: RgnHandle replacement? (From: Jonathan Wight <email@hidden>)

  • Prev by Date: Re: RgnHandle replacement?
  • Next by Date: Re: RgnHandle replacement?
  • Previous by thread: Re: RgnHandle replacement?
  • Next by thread: Re: RgnHandle replacement?
  • Index(es):
    • Date
    • Thread