卷起千堆雪tyn, 你运行一下和我星期天遇到的情况一样,一开始自动画一个,可画布有不能(0分)

  • 主题发起人 主题发起人 suns
  • 开始时间 开始时间
S

suns

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
x0,y0 :Integer;
begin
with Canvas do
begin
MoveTo(x0-20,y0);
LineTo(x0+20,y0);
MoveTo(x0,y0-20);
LineTo(x0,y0+20);
Pen.Mode :=pmNotXor;
MoveTo(x-20,y);
LineTo(x+20,y);
MoveTo(x,y-20);
LineTo(x,y+20);
end;
x0 :=x;
y0 :=y;
end;
 
什么都要我来做???你就不会自己加一个判断标志???
再给你写一个,应该可以了吧???

var
Form1: TForm1;
First :Boolean;
OX,OY :Integer;

implementation

{$R *.DFM}

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if not First then Canvas.Ellipse(ox,oy,ox+150,oy+150);
Canvas.Ellipse(X,Y,X+150,Y+150);
OX:=X;
OY:=Y;
First:=False;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Canvas.Pen.Mode :=pmNotXor;
First :=True;
end;
 
后退
顶部