卷起千堆雪tyn, 快进来(0分)

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

suns

Unregistered / Unconfirmed
GUEST, unregistred user!
来自:卷起千堆雪tyn, 时间:2002-1-6 18:40:00, ID:838602
来试试,呵呵

var
Form1: TForm1;
xx,yy :Integer;

implementation

{$R *.DFM}

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
xx :=x;
yy :=y;
Invalidate;
end;

procedure TForm1.FormPaint(Sender: TObject);
begin
with Canvas do
begin
MoveTo(0,yy);
LineTo(Form1.Width,yy);
MoveTo(xx,0);
LineTo(xx,Form1.Height);
end;
end;
我的画布上还有我自己画的一些坐标,所以Invalidate不能要,但我去掉后,画的线没颜色拉
 
这样来~~~

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;
 

Similar threads

后退
顶部