📄 upolypolyline.pas
字号:
unit UPolyPolyLine;
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..11] of TPoint; // the vertices defining the polygons
NPoints: array[0..1] of Integer; // the number of vertices in each polygon
begin
{define the polygons -}
{first 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;
{second polygon}
PointsArray[7].X := 200;
PointsArray[7].y := 25;
PointsArray[8].X := 300;
PointsArray[8].Y := 25;
PointsArray[9].X := 300;
PointsArray[9].Y := 125;
PointsArray[10].X := 200;
PointsArray[10].Y := 125;
PointsArray[11].X := 200;
PointsArray[11].Y := 25;
{indicate how many vertices are in each polygon}
NPoints[0] := 7;
NPoints[1] := 5;
{draw the unfilled polygons}
PolyPolyLine(Canvas.Handle, PointsArray, NPoints, 2);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -