procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image1.Picture.Bitmap.Canvas.Brush.Style:=bsClear;
image1.Picture.Bitmap.Canvas.TextOut(50,50,inttostr(x));
end;我想实现在(50,50)这点滚动显示鼠标的x值,不显示数字框,我上面的程得到结果是所有的数字重叠在一起,而不是数字的滚动效果,请各位指教.
Y: Integer);
begin
image1.Picture.Bitmap.Canvas.Brush.Style:=bsClear;
image1.Picture.Bitmap.Canvas.TextOut(50,50,inttostr(x));
end;我想实现在(50,50)这点滚动显示鼠标的x值,不显示数字框,我上面的程得到结果是所有的数字重叠在一起,而不是数字的滚动效果,请各位指教.
x1:integer
给x1初值为0
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
with image1.Picture.Bitmap.Canvas do
begin
Brush.Style:=bsClear;
Font.Color:=clbtnface; //你的底色
TextOut(50,50,inttostr(x1));
Font.Color:=clbtntext; //你字体的颜色
TextOut(50,50,inttostr(x));
x1:=x;
end;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image1.Picture.Bitmap.Canvas.Brush.Style:=bsClear;
//image1.Picture.Bitmap.Canvas.TextOut(50,50,inttostr(x));
Lable1.Caption:=inttostr(x);
end;
既是Image那所谓底色一定不是单色的。
把Bmp存成变量
每次改变都重新画一遍数字所在Rect
再写上字,这样还差不多。
iamge2.canvas.brush.style:=bsClear;
for i:=0 to image2.heigth-1 do
begin
image2.canvas.textout(0,i,' ');
end;
image2.canvas.textout(50,50,inttostr(x));