📄 upolylineto.pas
字号:
unit UPolyLineTo;
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..5] of TPoint; // the points defining the polygon
begin
{move the current position to where the polygon will start}
MoveToEx(Canvas.Handle, 50, 50, nil);
{define the polygon}
PointsArray[0].x := 100;
PointsArray[0].y := 50;
PointsArray[1].x := 125;
PointsArray[1].y := 75;
PointsArray[2].x := 100;
PointsArray[2].y := 100;
PointsArray[3].x := 50;
PointsArray[3].y := 100;
PointsArray[4].x := 25;
PointsArray[4].y := 75;
PointsArray[5].X := 50;
PointsArray[5].Y := 50;
{draw the polygon, starting at the current position}
PolyLineTo(Canvas.Handle, PointsArray, 6);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -