I want to convert from points to pixels (C#) based on current machine’s dpi. While doing so, a particular machine (Lenovo Yoga 500) returns 144 dpi in WPF application and 96 dpi in Windows Forms application. This is quite strange to get different values from same machine.
This is my code.
Graphics graphics = Graphics.FromHwnd(IntPtr.Zero);
MessageBox.Show(“DPI : “ + graphics.DpiX.ToString());
Need someone to help me on this to get same value.