• 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: "John C. Randolph" <email@hidden>
  • Date: Sun, 25 Jan 2009 17:10:14 -0800


On Jan 25, 2009, at 11:06 AM, Ashley Perrien wrote:

Is there a way to get the color of a pixel or area of an NSView during the drawRect method?

Sure. Have a look at this:

http://developer.apple.com/samplecode/Color_Sampler/index.html

NSReadPixel() will tell you the color of the pixel nearest to the given location, in the current drawing context.

-jcr


"This is not a book to be tossed aside lightly. Rather, it should be hurled with great force." -Dorothy Parker


_______________________________________________

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: Re: NSArray KVC proxy
  • Next by Date: Re: NSRunloop performSelector needs CFRunLoopWakeUp ?
  • Previous by thread: Re: Getting pixel color from NSView
  • Next by thread: CFHTTP +authentication
  • Index(es):
    • Date
    • Thread