LuciadCPillar C# 2023.1.04
Luciad.Input.ScreenDistance Class Reference

This class is used to represent distances between screen locations. More...

Inheritance diagram for Luciad.Input.ScreenDistance:

Public Member Functions

 ScreenDistance (double distance, Luciad.Input.ScreenDistanceUnit unit)
 
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]
 
double Value [get]
 

Detailed Description

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. 2022.0

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ScreenDistance.

Constructor & Destructor Documentation

◆ ScreenDistance()

Luciad.Input.ScreenDistance.ScreenDistance ( double  distance,
Luciad.Input.ScreenDistanceUnit  unit 
)
inline

Member Function Documentation

◆ AsMillimeters()

double Luciad.Input.ScreenDistance.AsMillimeters ( double  dpi,
double  displayScale 
)
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

the screen distance in millimeters, as a double.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ScreenDistance::asMillimeters.

◆ AsPixels()

double Luciad.Input.ScreenDistance.AsPixels ( double  dpi,
double  displayScale 
)
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

the screen distance in device independent pixels, as a double.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ScreenDistance::asPixels.

◆ Dispose()

void Luciad.Input.ScreenDistance.Dispose ( )
inline

◆ Millimeters()

Luciad.Input.ScreenDistance Luciad.Input.ScreenDistance.Millimeters ( double  millimeters)
inlinestatic

Utility factory method for constructing a ScreenDistance expressed in millimeters.

millimeters

the distance in millimeters.

a ScreenDistance instance taking the passed value and expressed in millimeters.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ScreenDistance::millimeters.

◆ Pixels()

Luciad.Input.ScreenDistance Luciad.Input.ScreenDistance.Pixels ( double  pixels)
inlinestatic

Utility factory method for constructing a ScreenDistance expressed in device independent pixels.

pixels

the distance in device independent pixels.

a ScreenDistance instance taking the passed value and expressed in device independent pixels.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ScreenDistance::pixels.

Property Documentation

◆ Unit

Luciad.Input.ScreenDistanceUnit Luciad.Input.ScreenDistance.Unit
get

◆ Value

double Luciad.Input.ScreenDistance.Value
get