ID2D1Factory::GetDesktopDpi method (d2d1.h)

Important

ID2D1Factory::GetDesktopDpi is deprecated. For a desktop app, instead use GetDpiForWindow. For a Universal Windows Platform (UWP) app, instead use DisplayInformation::LogicalDpi.

Retrieves the current desktop dots per inch (DPI). To refresh this value, call ReloadSystemMetrics.

Syntax

void GetDesktopDpi(
  [out] FLOAT *dpiX,
  [out] FLOAT *dpiY
);

Parameters

[out] dpiX

Type: FLOAT*

When this method returns, contains the horizontal DPI of the desktop. You must allocate storage for this parameter.

[out] dpiY

Type: FLOAT*

When this method returns, contains the vertical DPI of the desktop. You must allocate storage for this parameter.

Return value

None

Remarks

Use this method to obtain the system DPI when setting physical pixel values, such as when you specify the size of a window.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1.h
Library D2d1.lib
DLL D2d1.dll

See also