怎么又来了?
var
Form1: TForm1;
Draw :Boolean;
implementation
{$R *.DFM}
procedure TForm1.FormMouseDown(Sender: TObject
Button: TMouseButton;
Shift: TShiftState
X, Y: Integer);
begin
Draw :=True;
Canvas.MoveTo(x,y);
end;
procedure TForm1.FormMouseMove(Sender: TObject
Shift: TShiftState
X,
Y: Integer);
begin
if Draw then
Canvas.LineTo(x,y);
end;
procedure TForm1.FormMouseUp(Sender: TObject
Button: TMouseButton;
Shift: TShiftState
X, Y: Integer);
begin
Draw :=False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Draw :=False;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Bmp :TBitmap;
begin
Bmp :=TBitmap.Create;
Bmp.Width :=Form1.ClientWidth;
Bmp.Height :=Form1.ClientHeight;
BitBlt(Bmp.Canvas.Handle,0,0,Bmp.Width,Bmp.Height,Form1.Canvas.Handle,0,0,SRCCOPY);
Bmp.SaveToFile('c:/tyn.bmp');
Bmp.Free;
end;