D2D1_UNIT_MODE enumeration (d2d1_1.h)

Specifies how units in Direct2D will be interpreted.

Syntax

typedef enum D2D1_UNIT_MODE {
  D2D1_UNIT_MODE_DIPS = 0,
  D2D1_UNIT_MODE_PIXELS = 1,
  D2D1_UNIT_MODE_FORCE_DWORD = 0xffffffff
} ;

Constants

 
D2D1_UNIT_MODE_DIPS
Value: 0
Units will be interpreted as device-independent pixels (1/96").
D2D1_UNIT_MODE_PIXELS
Value: 1
Units will be interpreted as pixels.
D2D1_UNIT_MODE_FORCE_DWORD
Value: 0xffffffff

Remarks

Setting the unit mode to D2D1_UNIT_MODE_PIXELS is similar to setting the ID2D1DeviceContext dots per inch (dpi) to 96. However, Direct2D still checks the dpi to determine the threshold for enabling vertical antialiasing for text, and when the unit mode is restored, the dpi will be remembered.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Header d2d1_1.h

See also

ID2D1DeviceContext::GetUnitMode

ID2D1DeviceContext::SetUnitMode