readPixels Method


Read selected data about each pixel within a rectangular region of this Viewport.

readPixels(rect: ViewRect, selector: Pixel.Selector, receiver: Pixel.Receiver, excludeNonLocatable: boolean = false): void

note The Pixel.Buffer supplied to the receiver function becomes invalid once that function exits. Do not store a reference to it.

Parameter Type Description
rect ViewRect The area of the viewport's contents to read. The origin specifies the upper-left corner. Must lie entirely within the viewport's dimensions.
selector Pixel.Selector Specifies which aspect(s) of data to read.
receiver Pixel.Receiver A function accepting a Pixel.Buffer object from which the selected data can be retrieved, or receiving undefined if the viewport is not active, the rect is out of bounds, or some other error.
excludeNonLocatable boolean If true, geometry with the "non-locatable" flag set will not be drawn.

Defined in

Last Updated: 20 September, 2019