NSReadPixel(_:)
Reads the color of the pixel at the specified location.
Declaration
func NSReadPixel(_ passedPoint: NSPoint) -> NSColor?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.
See Also
Functions
NSConvertGlyphsToPackedGlyphs(_:_:_:_:)raiseBadArgumentException(_:_:_:)NSReleaseAlertPanel(_:)NSDisableScreenUpdates()NSEnableScreenUpdates()NSDrawColorTiledRects(_:_:_:_:_:)NSSetShowsServicesMenuItem(_:_:)NSCopyBits(_:_:_:)NSShowsServicesMenuItem(_:)NSDottedFrameRect(_:)NSGetWindowServerMemory(_:_:_:_:)fileContentsType(forPathExtension:)fileNameType(forPathExtension:)representedPathExtensionrepresentedPathExtensions(from:)