Re: Accessing the RGB values of one pixel in an NSImage
On Tuesday, August 20, 2002, at 05:36 AM, Arthur VIGAN wrote:
Hi,
I'd like to know if it is possible to access the RGB values of each
pixel
separately in an NSImage?
Thanks in advance.
Arthur
----From the doc's---- NSReadPixel This function reads a pixel value at the specified location. NSColor *NSReadPixel(NSPoint passedPoint) Returns the color of the pixel at the given location. The location argument is taken in the current coordinate system-in other words, you must lock focus on the View that contains the pixel that you wish to query, and then pass the coordinate for the pixel in the View's coordinate system. ----<Snip>------ I have never used this function before. I would assume that your NSImage would have to be displayed, unobstructed, in the frontmost window. But I really don't know. I'm pretty sure that the color you would be reading off the screen and the color that has been stored in the image will not match 100% unless the color profile was imbeded in the image file. Roarke Lynch ------------------------------- rlynchba@earthlink.net _______________________________________________ cocoa-dev mailing list | cocoa-dev@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev Do not post admin requests to the list. They will be ignored.
participants (1)
-
Roarke Lynch