怎样用image 中的canvas画图,步骤是什么,只画几个简单的线条就可以了。(我是新手,请指导得详细一些。)
---------回复--------------
Canvas.Pen.Color设置颜色
Canvas.Pen.Width设置宽度
Canvas.Pen.Style设置线型
Canvas.MoveTo设置线起点
Canvas.LineTo设置线终点
---------回复--------------
var
Form1: TForm1;
pt:tpoint;
implementation
{$R *.dfm}
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Image1.Canvas.MoveTo(pt.X,pt.Y);
Image1.Canvas.LineTo(x,y);
pt.X:=x;
pt.Y:=y;
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
pt.x:=x;
pt.Y:=y;
end;
关键字词: