如下例:在Delphi在线帮助里,使用TCanvas类
procedure TForm1.Button1Click(Sender: TObject);
begin
with Form1 do
begin
Canvas.Pen.Color := clBlue;
Canvas.MoveTo( 10, 10 );
Canvas.LineTo( 100, 100 );
Canvas.Brush.Color := clBtnFace;
Canvas.Font.Name := 'Arial';
Canvas.TextOut( Canvas.PenPos.x, Canvas.PenPos.y,'This is the end of the line' );
end;
end;