public void Dispose() { Win32FontSystem.SelectObject(_hDC, _prevObject); if (_graphics != null) { _graphics.ReleaseHdc(_hDC); } _hDC = _prevObject = IntPtr.Zero; _graphics = null; }
public GdiObjectSelector(IntPtr hDC, IntPtr hObject) { _hDC = hDC; _prevObject = Win32FontSystem.SelectObject(_hDC, hObject); }
public GdiObjectSelector(Graphics g, IntPtr hObject) { _graphics = g; _hDC = g.GetHdc(); _prevObject = Win32FontSystem.SelectObject(_hDC, hObject); }