FMX.Graphics.TPathData.Data

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Data: string read GetPathString write SetPathString stored False;

C++

__property System::UnicodeString Data = {read=GetPathString, write=SetPathString, stored=false};

Properties

Type Visibility Source Unit Parent
property published
FMX.Graphics.pas
FMX.Graphics.hpp
FMX.Graphics TPathData

Description

Specifies the current TPathData by a sequence of characters.

Data is a string composed of characters that indicate the type and the coordinates of the points of the primitive shapes for the current TPathData. Set Data to define and populate TPathData with primitive shapes.

When setting it, the Data value has the following structure:

 'character' 'points or values'[ 'next shape'].

'character' specifies the type of the shape.

'points or values' indicates the points coordinates or the values that define the shape.

A moved point or a line is specified by a point, and a curve is specified by three points. If the line is vertical or horizontal, it is necessary to specify only the y- or x-coordinate of the end of the line, respectively.

The coordinates of a point are separated by ',' (comma) or ' '(space character). Two consecutive shapes are separated by ',' or ' '. If the shape is defined by more than one point and value, they are separated by ',' or ' '.

'character' can have the following values:

Value Meaning

'z'

Defines a closed path.

'Z'

Defines a closed path.

'M'

Defines a point moved by calling MoveTo. If more than one point can be found after 'M', lines are added to connect the points in the order they appear in the string.

'm'

Defines a point moved by calling MoveToRel. If more than one point can be found after 'm', lines are added to connect the points in the order they appear in the string.

'L'

Defines a sequence of one or more lines, added by calling LineTo. The added lines connect the points in the order they appear in the string.

'l'

Defines a sequence of one or more lines, added by calling LineToRel. The added lines connect the points in the order they appear in the string.

'C'

Defines a sequence of one or more curves, added by calling CurveTo. The added curves connect the points in the order they appear in the string.

'c'

Defines a sequence of one or more curves, added by calling CurveToRel. The added curves connect the points in the order they appear in the string

'S'

Defines a sequence of one or more smooth curves, added by calling SmoothCurveTo. The added curves connect the points in the order they appear in the string.

's'

Defines a sequence of one or more smooth curves, added by calling SmoothCurveToRel. The added curves connect the points in the order they appear in the string.

'H'

Defines a line, added by calling HLineTo.

'h'

Defines a line, added by calling HLineToRel.

'V'

Defines a line, added by calling VLineTo.

'v'

Defines a line, added by calling VLineToRel.

'A'

Defines an arc. An arc is defined by the center point, the rays of the parent ellipse, the angle of the arc, two flags, and the end point.

'a'

Defines an arc. The arc coordinates are calculated related to the last point of the TPathData. An arc is defined by the center point, the rays of the parent ellipse, the angle of the arc, two flags, and the end point.

Example:

//moved start point to (20,20)
// added 3 lines, a curve and an arc
Mypath.Data:='m20,20 L40,10 50,30 140,100 C20,30 100,180 250,200 A15,15,90,90,90,150,150 z';

When getting it, the Data value has the following structure:

 'character' 'points'[ 'next shape'].

'character' specifies the type of the shape or point.

'points' specifies the points that defines the shape.

'character' can have the following values:

Value Meaning

'Z'

Defines a closed path.

'M'

Defines a moved point.

'L'

Defines a line.

'C'

Defines a curve.

Example:

str:=Mypath.Data;
//The result is: str='M 20,20 L 40,10 L 50,30 L 140,100 C 20,30 100,180 250,200 Z ';

See Also