Delphi Win32核心API参考光盘源码
本书包含了常用的Windows API函数
源代码在线查看: upolyline.pas
unit UPolyLine;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormPaint(Sender: TObject);
var
PointsArray: array[0..6] of TPoint; // points defining the polygon
begin
{define the vertices of the polygon}
PointsArray[0].X := 50;
PointsArray[0].y := 50;
PointsArray[1].x := 100;
PointsArray[1].y := 50;
PointsArray[2].x := 125;
PointsArray[2].y := 75;
PointsArray[3].x := 100;
PointsArray[3].y := 100;
PointsArray[4].x := 50;
PointsArray[4].y := 100;
PointsArray[5].x := 25;
PointsArray[5].y := 75;
PointsArray[6].X := 50;
PointsArray[6].Y := 50;
{draw the polygon}
PolyLine(Canvas.Handle, PointsArray, 7);
end;
end.