예제 #1
0
        private void TipCapture()
        {
            IntPtr handle = Handle;

            if (handle == IntPtr.Zero)
            {
                return;
            }

            RECT rect = new RECT();

            NativeMethodsToop.GetWindowRect(handle, ref rect);

            Size size = new Size(
                rect.Right - rect.Left,
                rect.Bottom - rect.Top);

            _backDc = new ImageDc(size.Width, size.Height);
            IntPtr pD = NativeMethodsToop.GetDesktopWindow();
            IntPtr pH = NativeMethodsToop.GetDC(pD);

            NativeMethodsToop.BitBlt(
                _backDc.Hdc,
                0, 0, size.Width, size.Height,
                pH, rect.Left, rect.Top, 0xCC0020);
            NativeMethodsToop.ReleaseDC(pD, pH);
        }
예제 #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                if (_backDc != null)
                {
                    _backDc.Dispose();
                    _backDc = null;
                }

                if (!_titleFont.IsSystemFont)
                {
                    _titleFont.Dispose();
                }
                _titleFont = null;

                _image      = null;
                _colorTable = null;
            }
        }