BitmapImage.DecodePixelType property

Applies to Windows and Windows Phone

Gets or sets a value that determines how DecodePixelWidth and DecodePixelHeight values are interpreted for decoding operations.

Syntax


public DecodePixelType DecodePixelType { get; set; }

Property value

Type: DecodePixelType

A value of the enumeration. The default is Physical.

Remarks

DecodePixelType can be set to Logical or Physical. The default value is Physical. If DecodePixelType is not set, or set to Physical, the image is decoded using DecodePixelWidth and DecodePixelHeight values that represent physical pixels, and the decode operation uses these values directly. If DecodePixelType is set to Logical, the image is decoded using DecodePixelWidth and DecodePixelHeight values that represent logical pixels. Internal logic converts the decode width and height based on device resolution info and how logical and physical pixels are factored on the target device.

Width and Height for the Image element are specified in logical pixels once the image is rendered, but those logical pixels are influenced by the device resolution. For the BitmapImage element that represents the image file source, DecodePixelWidth and DecodePixelHeight are specified in physical pixels, by default. The physical pixel values for provided for the decode operation influences the size of the bitmap that's created in memory. By specifying DecodePixelType as Logical, the image is decoded using values that are pre-factored for the logical resolution, and it potentially won't use as much memory. For more info on device resolution and image sources, see Guidelines for scaling to pixel density.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Imaging
Windows::UI::Xaml::Media::Imaging [C++]

Metadata

Windows.winmd

See also

BitmapImage

 

 

Show:
© 2014 Microsoft