- var
- TempCanvas: TCanvas;
- BufDC: HDC;
- BufBitmap: HBITMAP;
- begin
-
- BufDC := CreateCompatibleDC(Canvas.Handle);
-
- BufBitmap := CreateCompatibleBitmap(Canvas.Handle, ClientWidth, ClientHeight);
-
- SelectObject(BufDC, BufBitmap);
-
-
- PerformEraseBackground(Self, BufDC);
-
- TempCanvas := TCanvas.Create;
-
- TempCanvas.Handle := BufDC;
-
- Randomize;
- TempCanvas.Brush.Color := Random($FFFFFF);
- TempCanvas.FrameRect(ClientRect);
-
- BitBlt(Canvas.Handle, 0, 0, ClientWidth, ClientHeight, TempCanvas.Handle, 0, 0, SRCCOPY);
-
- DeleteDC(BufDC);
- DeleteObject(BufBitmap);
- FreeAndNil(TempCanvas);
- end;
-
http://blog.csdn.net/aqtata/article/details/7710655
|
请发表评论