Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

length property

Gets or sets the number of pixel entries in a CanvasPixelArray object.

This property is read/write.

HTML Canvas 2D Context, Section 13Internet Explorer 9




object.length = number

number = object.length


Property values

Type: Integer

The number of pixel entries in an array.

Standards information


A unit of length represents the height and width attributes of an CanvasImageData object times four (that is, height × width × 4)

For an example of using length, see Sampling image colors with Canvas.

See also




© 2015 Microsoft