在Form上放一个Image控件,填写以下代码:
procedure TForm1.FormCreate(Sender: TObject);
const
PtArray: array[0..4, 0..1] of Integer = ((40, 40), (80, 40), (100, 100),
(200, 100), (240, 150));
var
dir: array[0..MAX_PATH - 1] of Char;
i: Integer;
begin
GetWindowsDirectory(@dir, MAX_PATH);
Image1.Picture.LoadFromFile(dir + '\Santa Fe Stucco.bmp');
Image1.Canvas.Pen.Width := 3;
Image1.Canvas.MoveTo(PtArray[0, 0], PtArray[0, 1]);
for i := 1 to Length(PtArray) - 1 do
Image1.Canvas.LineTo(PtArray[i, 0], PtArray[i, 1]);
end;