📄 upolybezierto.pas
字号:
unit UPolyBezierTo;
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
Points: array[0..2] of TPoint; // the points defining the bezier curve
begin
{define the bezier curve}
Points[0].X := 40;
Points[0].Y := 110;
Points[1].X := 80;
Points[1].Y := 30;
Points[2].X := 110;
Points[2].Y := 70;
{move the current position to the correct starting point}
MoveToEx(Canvas.Handle, 10, 70, NIL);
{draw the bezier curve}
PolyBezierTo(Canvas.Handle, Points, 3);
{the current position was updated, so we can use this to continue
drawing an image}
LineTo(Canvas.Handle, 110, 10);
LineTo(Canvas.Handle, 10, 10);
LineTo(Canvas.Handle, 10, 70);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -