public static WindowsGraphics FromHdc(IntPtr hDc) { DeviceContext dc = DeviceContext.FromHdc(hDc); return(new WindowsGraphics(dc) { _disposeDc = true // we create it, we dispose it. }); }
public static WindowsGraphics FromHdc(IntPtr hDc) { Debug.Assert(hDc != IntPtr.Zero, "null hDc"); DeviceContext dc = DeviceContext.FromHdc(hDc); WindowsGraphics wg = new WindowsGraphics(dc) { _disposeDc = true // we create it, we dispose it. }; return(wg); }