66 references to DpiUtil
PresentationCore (37)
MS\Internal\DpiScale2.cs (2)
207
return new DpiScale2(ppiX /
DpiUtil
.DefaultPixelsPerInch, ppiY /
DpiUtil
.DefaultPixelsPerInch);
MS\Internal\DpiUtil\DpiUtil.cs (4)
184
if (UIElement.DpiScaleXValues[index] == pixelsPerInchX /
DpiUtil
.DefaultPixelsPerInch &&
185
UIElement.DpiScaleYValues[index] == pixelsPerInchY /
DpiUtil
.DefaultPixelsPerInch)
194
UIElement.DpiScaleXValues.Add(pixelsPerInchX /
DpiUtil
.DefaultPixelsPerInch);
195
UIElement.DpiScaleYValues.Add(pixelsPerInchY /
DpiUtil
.DefaultPixelsPerInch);
MS\Internal\DpiUtil\DpiUtil+HwndDpiInfo.cs (3)
26
/// <param name="fallbackToNearestMonitorHeuristic">Semantics of this parameter are identical to that in <see cref="
DpiUtil
.GetWindowDpi"/></param>
28
item1: (DpiAwarenessContextValue)
DpiUtil
.GetDpiAwarenessContext(hWnd),
29
item2:
DpiUtil
.GetWindowDpi(hWnd, fallbackToNearestMonitorHeuristic))
System\Windows\DpiChangedEventArgs.cs (4)
46
OldDpi = new DpiScale(oldDpiX /
DpiUtil
.DefaultPixelsPerInch, oldDpiY /
DpiUtil
.DefaultPixelsPerInch);
47
NewDpi = new DpiScale(newDpiX /
DpiUtil
.DefaultPixelsPerInch, newDpiY /
DpiUtil
.DefaultPixelsPerInch);
System\Windows\DpiScale.cs (2)
64
get { return
DpiUtil
.DefaultPixelsPerInch * _dpiScaleX; }
75
get { return
DpiUtil
.DefaultPixelsPerInch * _dpiScaleY; }
System\Windows\Input\Stylus\Pointer\PointerTouchDevice.cs (1)
74
double pixelsPerInch =
DpiUtil
.DefaultPixelsPerInch;
System\Windows\Input\Stylus\Wisp\WispStylusTouchDevice.cs (1)
37
double pixelsPerInch =
DpiUtil
.DefaultPixelsPerInch;
System\Windows\InterOp\HwndTarget.cs (17)
331
DpiUtil
.UpdateUIElementCacheForSystemDpi(
DpiUtil
.GetSystemDpi());
337
DpiAwarenessContext = (DpiAwarenessContextValue)
DpiUtil
.GetDpiAwarenessContext(_hWnd);
363
appManifestProcessDpiAwareness =
DpiUtil
.GetProcessDpiAwareness(hWnd);
374
processDpiAwareness =
DpiUtil
.GetLegacyProcessDpiAwareness();
415
dpiScale =
DpiUtil
.GetWindowDpi(hWnd, fallbackToNearestMonitorHeuristic: false);
421
dpiScale =
DpiUtil
.GetSystemDpiFromUIElementCache();
425
dpiScale = DpiScale2.FromPixelsPerInch(
DpiUtil
.DefaultPixelsPerInch,
DpiUtil
.DefaultPixelsPerInch);
433
var dpiAwareness =
DpiUtil
.GetLegacyProcessDpiAwareness();
437
dpiScale =
DpiUtil
.GetSystemDpi();
441
?
DpiUtil
.GetWindowDpi(hWnd, fallbackToNearestMonitorHeuristic: false)
442
:
DpiUtil
.GetSystemDpi();
447
DpiUtil
.DefaultPixelsPerInch,
448
DpiUtil
.DefaultPixelsPerInch);
1704
var dpiFlags =
DpiUtil
.UpdateDpiScalesAndGetIndex(newDpi.PixelsPerInchX, newDpi.PixelsPerInchY);
2301
DpiFlags dpiFlags =
DpiUtil
.UpdateDpiScalesAndGetIndex(CurrentDpiScale.PixelsPerInchX, CurrentDpiScale.PixelsPerInchY);
System\Windows\Media\VisualTreeHelper.cs (1)
112
DpiFlags dpiFlags =
DpiUtil
.UpdateDpiScalesAndGetIndex(dpiInfo.PixelsPerInchX, dpiInfo.PixelsPerInchY);
System\Windows\UIElement.cs (2)
1149
_dpiScaleX = (double)dpiX /
DpiUtil
.DefaultPixelsPerInch;
1150
_dpiScaleY = (double)dpiY /
DpiUtil
.DefaultPixelsPerInch;
PresentationFramework (29)
System\Windows\Controls\Primitives\Popup.cs (1)
3525
return
DpiUtil
.GetProcessDpiAwareness(IntPtr.Zero) == NativeMethods.PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE;
System\Windows\Interop\HwndHost.cs (4)
416
DpiScale2 dpi =
DpiUtil
.GetWindowDpi(Handle, fallbackToNearestMonitorHeuristic: false);
417
DpiScale2 dpiParent =
DpiUtil
.GetWindowDpi(UnsafeNativeMethods.GetParent(_hwnd), fallbackToNearestMonitorHeuristic: false);
1030
if (
DpiUtil
.GetDpiAwarenessContext(_hwnd.Handle) !=
DpiUtil
.GetDpiAwarenessContext(hwndParent.Handle))
System\Windows\SystemParameters.cs (1)
1864
using (
DpiUtil
.WithDpiAwarenessContext(MS.Utility.DpiAwarenessContextValue.Unaware))
System\Windows\SystemResources.cs (22)
1005
/// on-demand by <see cref="EnsureResourceChangeListener(
DpiUtil
.HwndDpiInfo)"/>
1011
/// of <see cref="DpiAwarenessContextValue"/> + DPI that is observed - i.e., for each unique <see cref="
DpiUtil
.HwndDpiInfo"/>. This
1027
_hwndNotify = new Dictionary<
DpiUtil
.HwndDpiInfo, HwndWrapper>();
1028
_hwndNotifyHook = new Dictionary<
DpiUtil
.HwndDpiInfo, HwndWrapperHook>();
1029
_dpiAwarenessContextAndDpis = new List<
DpiUtil
.HwndDpiInfo>();
1046
private static bool EnsureResourceChangeListener(
DpiUtil
.HwndDpiInfo hwndDpiInfo)
1083
/// must only be called by <see cref="EnsureResourceChangeListener"/> or <see cref="EnsureResourceChangeListener(
DpiUtil
.HwndDpiInfo)"/>
1085
/// <returns><see cref="
DpiUtil
.HwndDpiInfo"/> of the newly created <see cref="HwndWrapper"/>, which is also a new key added into <see cref="_hwndNotify"/></returns>
1086
private static
DpiUtil
.HwndDpiInfo CreateResourceChangeListenerWindow(DpiAwarenessContextValue dpiContextValue, int x = 0, int y = 0, [System.Runtime.CompilerServices.CallerMemberName] string callerName = "")
1092
using (
DpiUtil
.WithDpiAwarenessContext(dpiContextValue))
1115
DpiUtil
.GetExtendedDpiInfoForWindow(hwndNotify.Handle):
1116
new
DpiUtil
.HwndDpiInfo(dpiContextValue, GetDpiScaleForUnawareOrSystemAwareContext(dpiContextValue));
1162
dpiScale = DpiScale2.FromPixelsPerInch(
DpiUtil
.DefaultPixelsPerInch,
DpiUtil
.DefaultPixelsPerInch);
1166
dpiScale =
DpiUtil
.GetSystemDpi();
1510
return
DpiUtil
.GetProcessDpiAwarenessContextValue(IntPtr.Zero);
1626
DpiUtil
.HwndDpiInfo hwndDpiInfo =
1628
DpiUtil
.GetExtendedDpiInfoForWindow(hwnd.Handle, fallbackToNearestMonitorHeuristic: true) :
1629
new
DpiUtil
.HwndDpiInfo(processDpiAwarenessContextValue, GetDpiScaleForUnawareOrSystemAwareContext(processDpiAwarenessContextValue));
1662
[ThreadStatic] private static List<
DpiUtil
.HwndDpiInfo> _dpiAwarenessContextAndDpis;
1664
[ThreadStatic] private static Dictionary<
DpiUtil
.HwndDpiInfo, HwndWrapper> _hwndNotify;
1665
[ThreadStatic] private static Dictionary<
DpiUtil
.HwndDpiInfo, HwndWrapperHook> _hwndNotifyHook;
System\Windows\Window.cs (1)
7818
return
DpiUtil
.GetProcessDpiAwareness(IntPtr.Zero) == NativeMethods.PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE;