unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Panel2: TPanel;
Button1: TButton;
Edit1: TEdit;
Image3: TImage;
PaintBox1: TPaintBox;
procedure Button1Click(Sender: TObject);
procedure PaintBox1Paint(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
bmp: TBitmap;
implementation
{$R *.dfm}
procedure TfrmXsjs.FormDestroy(Sender: TObject);
begin
inherited;
if assigned(bmp) then
bmp.free;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if not assigned(bmp) then
bmp := TBitmap.Create;
bmp.Transparent := true;
bmp.Width := clientRect.Right - clientRect.Left;
bmp.Height := clientRect.Bottom - clientRect.top;
bmp.Canvas.CopyRect(ClientRect, Canvas, ClientRect);
Panel2.Visible := true;
panel2.BringToFront;
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
if assigned(bmp) then
paintBox1.Canvas.CopyRect(ClientRect, bmp.Canvas, ClientRect);
end;
end.