Re: Getting pixel color from NSView
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