[ 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.
Assembly: System.Windows (in System.Windows.dll)
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.
A WriteableBitmap constructed with the WriteableBitmap(UIElement, Transform) overload will have an array length that is the product of the pre-translated width and height of the input UIElement. Typically, you can precalculate the array length if you need to by using ActualHeight times ActualWidth.
A WriteableBitmap constructed with the WriteableBitmap(BitmapSource) overload will have an array length that is the product of PixelWidth and PixelHeight, but evaluation of the array length is asynchronous. The length is 1 initially.
Position of pixels in the array is that .Pixels is the upper left corner of the image. .Pixels 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 array as part of a loop that goes through the entire array and sets integer values, representing the format pixels of the desired image.