Gets or sets the horizontal resolution in dots/inch (or DPI) of the image in Source. This is a dependency property.
public int SourceDpiX {get; set;}
Public Property SourceDpiX As Integer
The current horizontal resolution in dots/inch (or DPI) of the image in Source. Default value is 96.
The control will automatically extracts the horizontal and vertical resolution of the image in Source when a new image is set and put them in the SourceDpiX and SourceDpiY properties.
The values of SourceDpiX, SourceDpiY, ScreenDpiX and ScreenDpiY are used when calculating how to display the image if the value of UseDpi is set to true.
For example, a typical A4 document image is 8.5 by 11 inches. Which could be 2550 by 3300 pixels if the image has a resolution of 300 by 300. Most document viewer applications will try to display this image in its original size. i.e. the image will take 8.5 inches of screen horizontal space and 11 inches of screen vertical space. Without using the UseDpi property of this control, you are required to do the calculations yourself as follows:
control.UseDpi = false;
control.ScaleFactor = screenResolution / imageResolution;
In the case of the image above, this will be 96 (typical screen resolution) divided by 300. Or, you can set the UseDpi value to true and the control will use the above formula internally keeping the ScaleFactor set to 1 as follows:
control.UseDpi = true;
control.ScaleFactor = 1;
This code will produce the same result as the previous one.
The control will automatically set the ScreenDpiX and ScreenDpiY to the current screen resolution, also the SourceDpiX and SourceDpiY will be obtained from the current image set in Source. You can change these values if required for manual calculations.
Products |
Support |
Feedback: SourceDpiX Property (ImageBox) - Leadtools.Windows.Controls |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.