FGX.Canvas.Types.TfgPath: различия между версиями

Материал из FGX Native Докуметации
Перейти к навигации Перейти к поиску
(summary)
(summary)
Строка 109: Строка 109:
 
|-
 
|-
 
| <syntaxhighlight lang="Delphi">function</syntaxhighlight> || <code lang="Delphi">ToString(): [[string]]</code>
 
| <syntaxhighlight lang="Delphi">function</syntaxhighlight> || <code lang="Delphi">ToString(): [[string]]</code>
 +
 +
|}
 +
 +
== Свойства ==
 +
 +
{| class="wikitable sortable"
 +
|-
 +
| <syntaxhighlight lang="Delphi">property</syntaxhighlight> || <code>Count: [[Integer]]</code>
 +
 +
|-
 +
| <syntaxhighlight lang="Delphi">property</syntaxhighlight> || <code>Points[AIndex]: [[.TfgPathPoint|TfgPathPoint]]</code>
  
 
|}
 
|}

Версия 04:45, 10 июня 2019

Delphi

TfgPath = class (TfgPersistent)

Описание

Описание отсутствует.

Конструкторы

constructor
Create(AOwner: TPersistent)

Методы

function
MoveTo(const APoint: TPointF): TfgPath

Start a new sub-path at the given (x,y) coordinate. Absolute coordinates will follow. If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands. Hence, implicit lineto commands will be relative if the moveto is relative, and absolute if the moveto is absolute. If a relative moveto (m) appears as the first element of the path, then it is treated as a pair of absolute coordinates. In this case, subsequent pairs of coordinates are treated as relative even though the initial moveto is interpreted as an absolute moveto.

function
MoveTo(const AX: Single; const AY: Single): TfgPath
function
MoveToRel(const AVector: TPointF): TfgPath

Start a new sub-path at the given (x,y) coordinate. Relative coordinates will follow. If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands. Hence, implicit lineto commands will be relative if the moveto is relative, and absolute if the moveto is absolute. If a relative moveto (m) appears as the first element of the path, then it is treated as a pair of absolute coordinates. In this case, subsequent pairs of coordinates are treated as relative even though the initial moveto is interpreted as an absolute moveto.

function
MoveToRel(const ADX: Single; const ADY: Single): TfgPath
function
LineTo(const APoint: TPointF): TfgPath
function
LineTo(const AX: Single; const AY: Single): TfgPath
function
LineToRel(const AVector: TPointF): TfgPath
function
LineToRel(const ADX: Single; const ADY: Single): TfgPath
function
HLineTo(const AX: Single): TfgPath
function
HLineToRel(const AX: Single): TfgPath
function
VLineTo(const AY: Single): TfgPath
function
VLineToRel(const AY: Single): TfgPath
function
AddCurve(const AControlPoint1: TPointF; const AControlPoint2: TPointF; const AEndPoint: TPointF): TfgPath
function
AddCurveRel(const AControlPoint1: TPointF; const AControlPoint2: TPointF; const AEndPoint: TPointF): TfgPath
function
AddSmoothCurve(const AControlPoint2: TPointF; const AEndPoint: TPointF): TfgPath
function
AddSmoothCurveRel(const AControlPoint2: TPointF; const AEndPoint: TPointF): TfgPath
function
AddQuadraticCurve(const AControlPoint1: TPointF; const AEndPoint: TPointF): TfgPath

Draws a quadratic Bézier curve from the current point to (x,y) using (x1,y1) as the control point. Absolute coordinates will follow. Multiple sets of coordinates may be specified to draw a polybézier. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybézier.

function
AddQuadraticCurveRel(const AControlPoint1: TPointF; const AEndPoint: TPointF): TfgPath

Draws a quadratic Bézier curve from the current point to (x,y) using (x1,y1) as the control point. Relative coordinates will follow. Multiple sets of coordinates may be specified to draw a polybézier. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybézier.

function
AddSmoothQuadraticCurve(const AEndPoint: TPointF): TfgPath

Draws a quadratic Bézier curve from the current point to (x,y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a Q, q, T or t, assume the control point is coincident with the current point.) Absolute coordinates will follow; At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybézier.

function
AddSmoothQuadraticCurveRel(const AEndPoint: TPointF): TfgPath

Draws a quadratic Bézier curve from the current point to (x,y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a Q, q, T or t, assume the control point is coincident with the current point.) Relative coordinates will follow; At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybézier.

function
AddArc(const ARect: TRectF; const AStartAngle: Single; const ASweepAngle: Single): TfgPath

Добавляет дугу эллипса, вписанного в область ARect . Начало дуги задается углом AStartAngle в градусах. Конец дуги задается дельтой ASweepAngle в градусах, которая прибавляется к AStartAngle .

function
AddPath(const APath: TfgPath): TfgPath
function
ClosePath(): TfgPath
procedure
Clear()
procedure
FitInto(const ANewBounds: TRectF)
procedure
Translate(const AOffset: TPointF)
function
CalculateFrame(): TRectF

Вычисляет выпуклую оболочку расположения всего пути в локальных координатах пути.

function
FirstPoint(): TPointF

Возвращает первую точку в пути. Если ни одной точки нет, то вернет (0, 0).

function
LastPoint(): TPointF

Возвращает последнюю точку в пути. Если ни одной точки нет, то вернет (0, 0).

function
ToString(): string

Свойства

property
Count: Integer
property
Points[AIndex]: TfgPathPoint