using System.Windows.Interop;
using System.Drawing;
IntPtr intPtr = new WindowInteropHelper(this).Handle;
System.Windows.Forms.Screen cur_screen = System.Windows.Forms.Screen.FromHandle(intPtr);
Graphics cur_graph = Graphics.FromHwnd(intPtr);
double dpiXRatio = cur_graph.DpiX / 96;
double dpiYRatio = cur_graph.DpiY / 96;
double twidth = cur_screen.Bounds.Width / dpiXRatio;
double theight = cur_screen.Bounds.Height / dpiYRatio;