Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.03.25
UseDpi Property
See Also 
Leadtools.Windows.Controls Namespace > BitmapSourceViewer Class : UseDpi Property





Gets or sets a value that indicates whether LEAD's automated scaling properties are used to account for the physical resolution of the bitmap. This is a dependency property.

Syntax

Visual Basic (Declaration) 
Public Property UseDpi As Boolean
Visual Basic (Usage)Copy Code
Dim instance As BitmapSourceViewer
Dim value As Boolean
 
instance.UseDpi = value
 
value = instance.UseDpi
C# 
public bool UseDpi {get; set;}
Managed Extensions for C++ 
public: __property bool get_UseDpi();
public: __property void set_UseDpi( 
   bool value
);
C++/CLI 
public:
property bool UseDpi {
   bool get();
   void set (bool value);
}
XAML Attributes Usage 

<object UseDpi=bool/>

Dependency Property Information 

Identifier field

UseDpiProperty

Metadata properties set to true

None

Return Value

true - calculate the width and height for the image according to the BitmapSource.DpiX and BitmapSource.DpiY, which can be obtained through BitmapSource.Width, BitmapSource.Height.
false- calculate the width and height for the image according to the BitmapSource.PixelWidth and BitmapSource.PixelHeight. Default value is true. This is the default behaviour in WPF.

Example

For XAML example, refer to BitmapSourceViewer.

For C#/VB examples, refer to BitmapSourceViewer.

Remarks

The physical resolution of an image is measured in dots per inch (DPI). When you load an image, the BitmapSource.XResolution and BitmapSource.YResolution properties are updated with the DPI values for the horizontal and vertical resolution. Some images have different horizontal and vertical resolutions. For example, the horizontal resolution of a fax image is typically twice its vertical resolution (for example 200 by 100). In such cases, the displayed images will appear elongated if you do not account for the resolution.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also