Table of Contents

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 DPIHelper

Inheritance

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

monitorBounds Rectangle

The rectangle defining the monitor bounds to query.

dpiType DPIHelper.DpiType

The type of DPI measurement to retrieve (Effective, Angular, or Raw).

dpiX uint

Output parameter that receives the horizontal DPI value.

dpiY uint

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.