Class DpiHelper
- Namespace
- LightningChartLib.WinForms.Charting
- Assembly
- LightningChart.WinForms.Charting.NET4.dll
Static helper class that contains helpers on DPI related issues. Meaning mainly PX to DIP conversions.
public static class DpiHelper
- Inheritance
-
DpiHelper
- Inherited Members
Properties
DpiAware
Defines if the system process is DPI aware or not. Currently there is no way distinguishing between system aware and Per-monitor aware.
public static bool DpiAware { get; }
Property Value
DpiXFactor
Effective Zoom factor of the system DPI of the screen width. Factor that describes how many real pixels there are per one DIP in X direction.
public static float DpiXFactor { get; }
Property Value
DpiYFactor
Effective Zoom factor of the system DPI of the screen height. Factor that describes how many real pixels there are per one DIP in Y direction.
public static float DpiYFactor { get; }
Property Value
Methods
DipToPx(double, bool)
Converts given DIP (Device Independent Pixels) values to PX (Screen pixels) using system DPI settings.
public static double DipToPx(double DIP, bool UseXDirection = true)
Parameters
DIPdoubleValue to convert in DIPs
UseXDirectionboolIf true, the screen width direction DPI factor is used. Height direction otherwise
Returns
- double
Converted value in PX.
Remarks
The UseXDirection has default value of true as the width and height direction DPI factors are usually the same.
DipToPx(ref RectangleF)
Converts given rectangle size and position defined in DIP (Device Independent Pixels) to PX (Screen pixels) values using system DPI settings.
public static void DipToPx(ref RectangleF PX)
Parameters
PXRectangleFRectangle to convert / modify, defined in DIPs.
DipToPx(float, bool)
Converts given DIP (Device Independent Pixels) values to PX (Screen pixels) using system DPI settings.
public static float DipToPx(float DIP, bool UseXDirection = true)
Parameters
DIPfloatValue to convert in DIPs
UseXDirectionboolIf true, the screen width direction DPI factor is used. Height direction otherwise
Returns
- float
Converted value in PX.
Remarks
The UseXDirection has default value of true as the width and height direction DPI factors are usually the same.
PxToDip(double, bool)
Converts given PX (Screen pixels) to DIP (Device Independent Pixels) values using system DPI settings.
public static double PxToDip(double PX, bool UseXDirection = true)
Parameters
PXdoubleValue to convert in pixels.
UseXDirectionboolIf true, the screen width direction DPI factor is used. Height direction otherwise
Returns
- double
Converted value in DPIs.
Remarks
The UseXDirection has default value of true as the width and height direction DPI factors are usually the same.
PxToDip(float, bool)
Converts given PX (Screen pixels) to DIP (Device Independent Pixels) values using system DPI settings.
public static float PxToDip(float PX, bool UseXDirection = true)
Parameters
PXfloatValue to convert in pixels.
UseXDirectionboolIf true, the screen width direction DPI factor is used. Height direction otherwise
Returns
- float
Converted value in DPIs.
Remarks
The UseXDirection has default value of true as the width and height direction DPI factors are usually the same.