Function

NSReadPixel

Reads the color of the pixel at the specified location.

Declaration

NSColor * NSReadPixel(NSPoint passedPoint);

Parameters

passedPoint

The pixel location to read, specified in the current coordinate system.

Return Value

The color of the pixel at the specified location.

Discussion

Because the passedPoint parameter is relative to the current coordinate system, if you wish to read a pixel from a specific view, you must convert points in the view’s coordinate system to the current coordinate system before calling this function. Alternatively, you can lock focus on the view and then specify the pixel coordinate in the view’s coordinate system.

When mapping the specified point to pixel boundaries, this method rounds to the nearest pixel. For more information on how coordinate points map to the underlying pixels, see Coordinate Systems and Transforms in Cocoa Drawing Guide.

See Also

Auxiliary Functions

NSDrawColorTiledRects

Draws a colored bordered rectangle.

NSInterfaceStyleForKey

Returns an interface style value for the specified key and responder.

Deprecated
NSSetShowsServicesMenuItem

Specifies whether an item should be included in Services menus.

NSCopyBits

Copies a bitmap image to the location specified by a destination point.

Deprecated
NSCountWindows

Counts the number of onscreen windows.

Deprecated
NSCountWindowsForContext

Counts the number of onscreen windows belonging to a particular application.

Deprecated
NSShowsServicesMenuItem

Specifies whether a Services menu item is currently enabled.

NSDottedFrameRect

Draws a bordered rectangle.

NSWindowList

Gets information about onscreen windows.

Deprecated
NSWindowListForContext

Gets information about an application’s onscreen windows.

Deprecated
NSGetWindowServerMemory

Returns the amount of memory being used by a context.

Deprecated