![]() |
LuciadCPillar C# 2024.1.04
|
This class is used to represent distances between screen locations. More...
Public Member Functions | |
ScreenDistance (double distance, Luciad.Input.ScreenDistanceUnit unit) | |
Explicit constructor taking a distance value and a unit. More... | |
double | AsMillimeters (double dpi, double displayScale) |
Converting value method which returns the distance value as a double, expressed in millimeters. More... | |
double | AsPixels (double dpi, double displayScale) |
Converting value method which returns the distance value as a double, expressed in device independent pixels. More... | |
void | Dispose () |
Static Public Member Functions | |
static Luciad.Input.ScreenDistance | Millimeters (double millimeters) |
Utility factory method for constructing a ScreenDistance expressed in millimeters. More... | |
static Luciad.Input.ScreenDistance | Pixels (double pixels) |
Utility factory method for constructing a ScreenDistance expressed in device independent pixels. More... | |
Properties | |
Luciad.Input.ScreenDistanceUnit | Unit [get] |
The screen distance unit. More... | |
double | Value [get] |
The screen distance value, as a double. More... | |
This class is used to represent distances between screen locations.
It consists of a unit (expressed as a ScreenDistanceUnit) and the distance value.
This class contains utility methods for converting distance values from millimeters to pixels or vice-versa, by taking DPI and display scale into account (see ScreenDistance#asPixels
and ScreenDistance#asMillimeters
).
Related article: Support high-resolution (HiDPI) displays.
|
inline |
Explicit constructor taking a distance value and a unit.
distance | the distance, expressed in the chosen unit. |
unit | either ScreenDistanceUnit.Pixels or ScreenDistanceUnit.Millimeters . |
|
inline |
Converting value method which returns the distance value as a double, expressed in millimeters.
In order to make any possible conversion from device independent pixels to millimeters, the display DPI and display scale must be provided. If the stored unit is ScreenDistanceUnit.Millimeters
, the currently stored value is returned.
dpi | the display density in dots per inch |
displayScale | the display scale |
|
inline |
Converting value method which returns the distance value as a double, expressed in device independent pixels.
In order to make any possible conversion from millimeters to pixels, the display DPI and display scale must be provided. If the stored unit is ScreenDistanceUnit.Pixels
, the currently stored value is returned.
dpi | the display density in dots per inch |
displayScale | the display scale |
|
inline |
|
inlinestatic |
Utility factory method for constructing a ScreenDistance
expressed in millimeters.
millimeters | the distance in millimeters. |
ScreenDistance
instance taking the passed value and expressed in millimeters.
|
inlinestatic |
Utility factory method for constructing a ScreenDistance
expressed in device independent pixels.
pixels | the distance in device independent pixels. |
ScreenDistance
instance taking the passed value and expressed in device independent pixels.
|
get |
The screen distance unit.
Returns the screen distance unit.
|
get |
The screen distance value, as a double.
Returns the screen distance value, as a double.