我帮你 Copy 了一个例子
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
{ first call FillRect to paint the surface of the form.
this removes any previously drawn lines (and anything else!) }
Canvas.FillRect(ClientRect);
Canvas.MoveTo(0, 0);
Canvas.LineTo(X, Y);
end;