upolybezierto.pas
来自「Delphi Win32核心API参考光盘源码 本书包含了常用的Windows」· PAS 代码 · 共 51 行
PAS
51 行
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 + =
减小字号Ctrl + -
显示快捷键?