Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetScaling()

float ReLogic.OS.Windows.WindowService.GetScaling ( )
inline

Implements ReLogic.OS.IWindowService.

Definition at line 9 of file WindowService.cs.

10 {
11 try
12 {
13 IntPtr dC = NativeMethods.GetDC(IntPtr.Zero);
14 int deviceCaps = NativeMethods.GetDeviceCaps(dC, NativeMethods.DeviceCap.VertRes);
15 return (float)NativeMethods.GetDeviceCaps(dC, NativeMethods.DeviceCap.DesktopVertRes) / (float)deviceCaps;
16 }
17 catch (Exception)
18 {
19 return 1f;
20 }
21 }
static readonly IntPtr Zero
Definition IntPtr.cs:18

References ReLogic.OS.Windows.NativeMethods.GetDC(), ReLogic.OS.Windows.NativeMethods.GetDeviceCaps(), and System.IntPtr.Zero.