• 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 00:29:42 -0500

On Wednesday, November 6, 2002, at 06:43 PM, Jonathan Wight wrote:

In my cocoa NSView subclass I have a bunch of icons and want to allow the
user to select them with a selection marquee. I've the core of this working
but to test if the icons are selected by the marquee I'm using
NSIntersectsRect to see if the marquee rectangle is intersecting the icon's
bounds rect.


You'd want to create an NSImage with the icon in it (oh, you probably already have that then right?), and then test the hit point to see if it has a pixel or not...

Here is someone doing something similar, and a thread where it was discussed

http://cocoa.mamasam.com/COCOADEV/2001/09/2/13509.php

(look at both JCR's response, and Ken Dyke's)

getting the color of a specific pixel is a pretty common operation, but it's dependent on the format of the underlying graphic at this point.. the bit level and format... you could simplify this if your image is always the same depth..

it'd be better if it was part of the API though.
_______________________________________________
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.

  • Follow-Ups:
    • Re: RgnHandle replacement?
      • From: Jonathan Wight <email@hidden>
References: 
 >RgnHandle replacement? (From: Jonathan Wight <email@hidden>)

  • Prev by Date: Re: Move a file to the Trash
  • Next by Date: Re: Getting thumbnail of document to appear?
  • Previous by thread: RgnHandle replacement?
  • Next by thread: Re: RgnHandle replacement?
  • Index(es):
    • Date
    • Thread