Pixels Property
Collapse the table of content
Expand the table of content

WriteableBitmap.Pixels Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets an array representing the 2-D texture of the bitmap.

Namespace:  System.Windows.Media.Imaging
Assembly:  System.Windows (in System.Windows.dll)

public int[] Pixels { get; }

Property Value

Type: System.Int32 []
An array of integers representing the 2-D texture of the bitmap.


The WriteableBitmap is created from protected content. The Pixels array is inaccessible in this case.

When assigning colors to pixels in your bitmap, use pre-multiplied colors. The format used by the WriteableBitmap is ARGB32 (premultiplied RGB). Similarly, if reading values from the array, treat these as ARGB32 (premultiplied RGB) values if you are reprocessing or rendering based on the values.

The length of the array is based on construction behavior.

Position of pixels in the array is that .Pixels[0] is the upper left corner of the image. .Pixels[1] is the pixel in the same row and to the immediate right, and so on. Scenarios that use WriteableBitmap either for algorithm-created images or for image format conversion typically use the Pixels array as part of a loop that goes through the entire array and sets integer values, representing the format pixels of the desired image.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft