Пример #1
0
        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);
            }
        }
Пример #2
0
        public void PopFont()
        {
            object o = fontStack.Pop();

            if (o != null)
            {
                Win32Util.SelectObject(hdc, (IntPtr)o);
            }
        }
Пример #3
0
        public void PushFont(object handle)
        {
            IntPtr oldFont = Win32Util.SelectObject(hdc, (IntPtr)handle);

            fontStack.Push(oldFont);
        }
Пример #4
0
 public int GetFontHeight()
 {
     return(Win32Util.GetTextHeight(hdc));
 }
Пример #5
0
 public int GetFontAscent()
 {
     return(Win32Util.GetTextAscent(hdc));
 }
Пример #6
0
 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);
 }