VisualTreeHelper.GetDpi(Visual) Method

Definition

Gets the DPI information at which this Visual is measured and rendered.

C#
public static System.Windows.DpiScale GetDpi(System.Windows.Media.Visual visual);

Parameters

visual
Visual

The Visual target object.

Returns

A DPIScale value.

Applies to

Product Versions
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10