Example #1
0
 protected override void Destroy()
 {
     if (hPen != (IntPtr)0)
     {
         NativeGdi32Api.DeleteObject(hPen);
     }
     base.Destroy();
     hPen = (IntPtr)0;
 }
Example #2
0
 protected override void Destroy()
 {
     if (hFont != (IntPtr)0)
     {
         NativeGdi32Api.DeleteObject(hFont);
     }
     base.Destroy();
     hFont = (IntPtr)0;
 }
Example #3
0
        //public void SetPixel(GDIColor color,int x,int y)
        //{
        //    NativeGdi32Api.SetPixel(_destDC, x, y, color.NativeColor);
        //}

        //public GDIColor GetPixel(int x, int y)
        //{
        //    int cl = NativeGdi32Api.GetPixel(_destDC,x,y);
        //    GDIColor color = new GDIColor(cl);
        //    return color;
        //}

        protected override void Destroy()
        {
            if (_hBmp != (IntPtr)0)
            {
                NativeGdi32Api.DeleteObject(_hBmp);
                NativeGdi32Api.DeleteDC(_destDC);
            }

            base.Destroy();
            _hBmp = (IntPtr)0;
        }
Example #4
0
        protected override void Destroy()
        {
            //only destroy if brush is created by us
            if (!mSystemBrush)
            {
                if (hBrush != (IntPtr)0)
                {
                    NativeGdi32Api.DeleteObject(hBrush);
                }
            }

            base.Destroy();
            hBrush = (IntPtr)0;
        }
Example #5
0
        protected override void Destroy()
        {
            if (_OldBmp != IntPtr.Zero)
            {
                NativeGdi32Api.SelectObject(this.hDC, _OldBmp);
            }

            if (_OldFont != IntPtr.Zero)
            {
                NativeGdi32Api.SelectObject(this.hDC, _OldFont);
            }

            if (_OldPen != IntPtr.Zero)
            {
                NativeGdi32Api.SelectObject(this.hDC, _OldPen);
            }

            if (_OldBrush != IntPtr.Zero)
            {
                NativeGdi32Api.SelectObject(this.hDC, _OldBrush);
            }

            if (mhBMP != (IntPtr)0)
            {
                NativeGdi32Api.DeleteObject(mhBMP);
            }

            if (mhDC != (IntPtr)0)
            {
                NativeGdi32Api.DeleteDC(mhDC);
            }

            mhBMP = (IntPtr)0;
            mhDC  = (IntPtr)0;

            base.Destroy();
        }