• 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: Getting pixel color from NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting pixel color from NSView


  • Subject: Re: Getting pixel color from NSView
  • From: Andrew Farmer <email@hidden>
  • Date: Sun, 25 Jan 2009 13:35:02 -0800

On 25 Jan 09, at 11:06, Ashley Perrien wrote:
Is there a way to get the color of a pixel or area of an NSView during the drawRect method? I'll be tiling the view with a grid of random colors but each tile is based on the colors around it...


While there are some methods you can use to determine the current color of a point on screen, there is no guarantee that they will be meaningful in the middle of a drawRect call.

... rather than creating and filling a potentially quite large array of colors.


This array is probably going to be a lot smaller than you're imagining it to be, especially if you use C arrays of color values for storage (rather than NSArray[NSArray[NSColor]]).
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Getting pixel color from NSView (From: Ashley Perrien <email@hidden>)

  • Prev by Date: Core Data performance [Re: Knowing when a NSArrayController is ready]
  • Next by Date: Re: Dates of the Chinese New Year
  • Previous by thread: Re: Getting pixel color from NSView
  • Next by thread: Re: Getting pixel color from NSView
  • Index(es):
    • Date
    • Thread