コード例 #1
0
        /// <summary>
        /// 取得背景圖樣
        /// </summary>
        private void TipCapture()
        {
            IntPtr handle = Handle;

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

            RECT rect = new RECT();

            NativeMethods.GetWindowRect(handle, ref rect);

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

            this._BackDc = new ToolTipImageDc(size.Width, size.Height);

            IntPtr pD = NativeMethods.GetDesktopWindow();

            IntPtr pH = NativeMethods.GetDC(pD);

            NativeMethods.BitBlt(this._BackDc.Hdc, 0, 0, size.Width, size.Height, pH, rect.Left, rect.Top, 0xCC0020);

            NativeMethods.ReleaseDC(pD, pH);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Disposing"></param>
        protected override void Dispose(bool Disposing)
        {
            base.Dispose(Disposing);

            if (Disposing)
            {
                if (this._BackDc != null)
                {
                    this._BackDc.Dispose();
                    this._BackDc = null;
                }
                if (!this._TitleFont.IsSystemFont)
                {
                    this._TitleFont.Dispose();
                }
                this._TitleFont  = null;
                this._Image      = null;
                this._ColorTable = null;
            }
        }