This documentation is archived and is not being maintained.

BitmapImage.DecodePixelHeight Property

Gets or sets the height, in pixels, that the image is decoded to. This is a dependency property.

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

public function get DecodePixelHeight () : int 
public function set DecodePixelHeight (value : int)
<object DecodePixelHeight="int" .../>

Property Value

Type: System.Int32
The height, in pixels, that the image is decoded to. The default value is 0.

Identifier field


Metadata properties set to true


If DecodePixelWidth is also set, the aspect ratio of the bitmap remains the same. If DecodePixelWidth is not set, the aspect ratio is ignored.

The JPEG and Portable Network Graphics (PNG) codecs natively decode the image to the specified size; other codecs decode the image at its original size and scale the image to the desired size.

The following code example demonstrates how to set the DecodePixelHeight property by using code.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0