As we know the Windows 7 available DPI scalings are 100%,125%,150% and 200%. The actual DPI value for these four DPI percentages are
Percentage - DPI Values
100% - 96
125% - 120
150% - 144
200% - 192
refer the link for DPI scaling: http://www.techrepublic.com/blog/windows-and-office/get-a-better-view-in-windows-7-by-adjusting-dpi-scaling/
Using C# i want to take the DPI value. So by following C# code am trying to achieve.
float x=0;
float y=0;
Graphics gp = Graphics.FromHwnd(IntPtr.Zero);// we can also use this.CreateGraphics()
x = gp.DpiX;
y = gp.DpiY;
Am getting the output as follows, which is wrong for 150% and 200%
100% - 96 //both x,y values
125% - 120 //both x,y values
**150% - 96 //both x,y values
200% - 96 //both x,y values**