public new void Dispose() { if (true) { throw new InvalidOperationException("here"); } if (originatingGraphics != null && !hdc.Equals(IntPtr.Zero)) { originatingGraphics.ReleaseHdc(hdc); Console.WriteLine("Released HDC"); } else { Console.WriteLine("HDC not released! Originating={0}, HDC={1}", originatingGraphics, hdc); } graphics.Dispose(); // if ( deleteHdcOnDispose ) Win32Util.DeleteDC(hdc); foreach (IntPtr fh in fontHandles.Values) { Win32Util.DeleteObject(fh); } }
public void PopFont() { object o = fontStack.Pop(); if (o != null) { Win32Util.SelectObject(hdc, (IntPtr)o); } }
public void PushFont(object handle) { IntPtr oldFont = Win32Util.SelectObject(hdc, (IntPtr)handle); fontStack.Push(oldFont); }
public int GetFontHeight() { return(Win32Util.GetTextHeight(hdc)); }
public int GetFontAscent() { return(Win32Util.GetTextAscent(hdc)); }
private void DrawSimpleText(Rectangle rc, int yOffset, string text, Color col, Color bkCol) { Win32Util.SetTextColor(hdc, col); Win32Util.SetBkColor(hdc, bkCol); Win32Util.ExtTextOut(hdc, rc.X, rc.Y + yOffset, rc, text); }