Class DPIHelper
- Namespace
- VisioForge.Core.Helpers
- Assembly
- VisioForge.Core.dll
Provides utility methods for retrieving DPI (dots per inch) information for monitors.
public static class DPIHelperInheritance
Inherited Members
Remarks
This helper class wraps Windows API calls to query monitor DPI settings, which is essential for proper scaling and rendering on high-DPI displays. It supports different DPI awareness modes including Effective, Angular, and Raw DPI measurements.
Methods
GetDpi(Rectangle, DpiType, out uint, out uint)
Retrieves the DPI values for the monitor containing the specified bounds.
public static void GetDpi(Rectangle monitorBounds, DPIHelper.DpiType dpiType, out uint dpiX, out uint dpiY)Parameters
monitorBoundsRectangle-
The rectangle defining the monitor bounds to query.
dpiTypeDPIHelper.DpiType-
The type of DPI measurement to retrieve (Effective, Angular, or Raw).
dpiXuint-
Output parameter that receives the horizontal DPI value.
dpiYuint-
Output parameter that receives the vertical DPI value.
Remarks
This method determines which monitor contains the specified bounds by checking a point within the bounds, then queries the DPI information for that monitor. If no monitor is found at the specified location, the nearest monitor is used.