public static WindowsGraphics FromHwnd(IntPtr hWnd) { DeviceContext dc = DeviceContext.FromHwnd(hWnd); return(new WindowsGraphics(dc) { _disposeDc = true // we create it, we dispose it. }); }