private void tipCapture() { RECT tR = new RECT(); GetWindowRect(_hTipWnd, ref tR); Size sZ = new Size(tR.Right - tR.Left, tR.Bottom - tR.Top); _cBgDc = new cStoreDc(); _cBgDc.Height = sZ.Height; _cBgDc.Width = sZ.Width; IntPtr pD = GetDesktopWindow(); IntPtr pH = GetDC(pD); BitBlt(_cBgDc.Hdc, 0, 0, sZ.Width, sZ.Height, pH, tR.Left, tR.Top, 0xCC0020); ReleaseDC(pD, pH); }
private void drawGraphic(Rectangle rDmn, IntPtr hdc, string caption, string title, IntPtr parent) { RECT tR = new RECT(); GetWindowRect(_hTipWnd, ref tR); // blit the capture, simulating transparency BitBlt(hdc, 0, 0, rDmn.Width, rDmn.Height, _cBgDc.Hdc, 0, 0, 0xCC0020); if (_bmGraphic != null) { cStoreDc cImage = new cStoreDc(); cStoreDc cDraw = new cStoreDc(); cImage.Height = _bmGraphic.Height; cImage.Width = _bmGraphic.Width; cDraw.Height = rDmn.Height; cDraw.Width = rDmn.Width; IntPtr hOld = SelectObject(cImage.Hdc, _bmGraphic.GetHbitmap()); // left side StretchBlt(cDraw.Hdc, 0, 3, 3, (rDmn.Height - 6), cImage.Hdc, 0, 3, 3, (cImage.Height - 6), 0xCC0020); // right side StretchBlt(cDraw.Hdc, (rDmn.Width - 3), 3, 3, (rDmn.Height - 6), cImage.Hdc, (cImage.Width - 3), 3, 3, (cImage.Height - 6), 0xCC0020); // top left corner StretchBlt(cDraw.Hdc, 0, 0, 3, 3, cImage.Hdc, 0, 0, 3, 3, 0xCC0020); // top StretchBlt(cDraw.Hdc, 3, 0, (rDmn.Width - 3), 3, cImage.Hdc, 3, 0, (cImage.Width - 3), 3, 0xCC0020); // bottom StretchBlt(cDraw.Hdc, 3, (rDmn.Height - 3), (rDmn.Width - 3), 3, cImage.Hdc, 3, (cImage.Height - 3), (cImage.Width - 3), 3, 0xCC0020); // bottom left corner StretchBlt(cDraw.Hdc, 0, (rDmn.Height - 3), 3, 3, cImage.Hdc, 0, (cImage.Height - 3), 3, 3, 0xCC0020); // center StretchBlt(cDraw.Hdc, 3, 3, (rDmn.Width - 6), (rDmn.Height - 6), cImage.Hdc, 3, 3, (cImage.Width - 6), (cImage.Height - 6), 0xCC0020); // draw to buffer byte bt = (byte)(_fOpacity * 255); alphaBlit(hdc, 0, 0, rDmn.Width, rDmn.Height, cDraw.Hdc, 0, 0, rDmn.Width, rDmn.Height, bt); SelectObject(cImage.Hdc, hOld); } }