A
alva_bai
Unregistered / Unconfirmed
GUEST, unregistred user!
var
dc, hMemDC: HDC;
Bitmap, pOldBitmap: HBITMAP;
begin
dc:= GetDC(pnl1.Handle);
hMemDC:= CreateCompatibleDC(DC);
Bitmap:= CreateCompatibleBitmap(DC,pnl1.Width,pnl1.Height);
pOldBitmap:= SelectObject(hMemDC, Bitmap);
//
// 画其它东西
//
StretchBlt( dc, 0, 0, pnl1.Width, pnl1.Height, hMemDC, 0, 0, pnl1.Width, pnl1.Height, SRCCOPY);
//BitBlt(dc, 50, 50, pnl1.Width, pnl1.Height, hMemDC, 0, 0, SRCCOPY);
Bitmap := SelectObject(hMemDC, pOldBitmap);
DeleteObject(Bitmap);
ReleaseDC(pnl1.Handle, DC);
DeleteDC(dc);
end;
dc, hMemDC: HDC;
Bitmap, pOldBitmap: HBITMAP;
begin
dc:= GetDC(pnl1.Handle);
hMemDC:= CreateCompatibleDC(DC);
Bitmap:= CreateCompatibleBitmap(DC,pnl1.Width,pnl1.Height);
pOldBitmap:= SelectObject(hMemDC, Bitmap);
//
// 画其它东西
//
StretchBlt( dc, 0, 0, pnl1.Width, pnl1.Height, hMemDC, 0, 0, pnl1.Width, pnl1.Height, SRCCOPY);
//BitBlt(dc, 50, 50, pnl1.Width, pnl1.Height, hMemDC, 0, 0, SRCCOPY);
Bitmap := SelectObject(hMemDC, pOldBitmap);
DeleteObject(Bitmap);
ReleaseDC(pnl1.Handle, DC);
DeleteDC(dc);
end;