BitmapImage.DecodePixelWidth Property

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

The width of a bitmap image.

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

Syntax

Public Property DecodePixelWidth As Integer
public int DecodePixelWidth { get; set; }

Property Value

Type: System..::.Int32
Returns the number of pixels equal to the width of an image.

Remarks

To preserve the aspect ratio of the image, we recommend that you typically use only one of the two pixel decoding settings (DecodePixelWidth or DecodePixelHeight).

If you specify BackgroundCreation in the CreateOptions of a BitmapImage, you have to specify only DecodePixelHeight. The DecodePixelWidth property is ignored when you specify BackgroundCreation.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0

See Also

Reference

BitmapImage Class

System.Windows.Media.Imaging Namespace