A TRSGPPath object stores a sequence of lines, curves, and shapes. You can draw the entire sequence by calling the TRSGPCanvas.DrawPath method. You can partition the sequence of lines, curves, and shapes into figures, and you can draw selected figures. You can also place markers in the sequence, so that you can draw selected portions of the path.
Namespace: RSGdiPlusGraphics
TPersistent |
Delphi |
type |
|
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: |
|||||||||||||||||||||||||||||||
'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 path. 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. |
Specifies how to fill areas when the path intersects itself.
Handle of the graphics object, used by the MS GDI+ flat API routines (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
Represents property IsModified.
Occurs when the graphics object changes.
Note |
---|
There are two events that are exactly the same, OnChanged and OnChange. The extra event name is to allow easier transition from other Delphi libraries, either the VCL (OnChanged) or FMX (OnChange) libraries. Use either one as needed. Only one event is triggered. |
Occurs when the graphics object changes.
Note |
---|
There are two events that are exactly the same, OnChanged and OnChange. The extra event name is to allow easier transition from other Delphi libraries, either the VCL (OnChanged) or FMX (OnChange) libraries. Use either one as needed. Only one event is triggered. |
Canvas that owns the object. The Canvas will free this graphics object if it is destroyed. However, to keep memory use under control, it is recommended that you free graphics objects when you are finished with them. (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
Specifies the points from the current path and theirs types.
Points gets the point and its type, specified by the index in the array of points of the path. Use Points to access the internal array of TRSGPPathPoint of the path.
AIndex specifies an index in the points array of the path.
Represents property UpdateCount.
CurveTo adds ControlPoint1, ControlPoint2, and EndPoint to the Points array. The added point is of type CurveTo. To move the start point of the line, call MoveTo or MoveToRel before calling CurveTo. To find the end point of the path, call the LastPoint method. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Appends a curve to the current path. The curve is defined by 4 points that depend on the end point of the current path : • The start point of the curve is the end point of the path. • The ControlPoint1 and ControlPoint2 parameters' coordinates specify the distances to the end point of the current path, on each axis, for each of the two control points of the curve. • The EndPoint parameter's coordinates specify the distances to the end point of the current path, on each axis, for the end point of the curve. |
CurveToRel adds the two control points and the end point of the curve to the Points array. The added point is of type CurveTo. To move the start point of the line, call MoveTo or MoveToRel before calling SmoothCurveTo.
To find the end point of the path, call the LastPoint method.
Marks the end of an update session of the element and its children.
The update session must be started first by calling BeginUpdate.
EndUpdate decreases a updating semaphore. If all update sessions end and the semaphore is 0, EndUpdate signals a OnChange event.
Translates and scales the current path to fit a specified rectangle area. The ARect parameter specifies the rectangle area to fit the path in.
Converts each curve in the current TPathData into a sequence of connected line segments.
The Flatness parameter specifies the maximum permitted error between the curve and its flattened approximation. By default, it is 0.25. Reducing the flatness value will increase the number of line segments in the approximation.
Returns the bounding rectangle of the current path. When the path is drawn, the rectangle returned by GetBounds is not affected by the thickness and style of the pen stroke.
Returns a RSGdiPlusGraphicsTypes.TRSGPPathPoint enumerator.
GetEnumerator returns a TPathPointEnumerator reference, which enumerates the path points contained within the path.
To process all these path points, call the TPathPointEnumerator GetCurrent method within a While MoveNext do loop.
Call this method to acquire a handle from the GDI+ flat API library (Overrides RSGdiPlusGraphics.TRSGPGraphicsObject.GetHandle.)
Returns the record containing the path data (points and kinds)
Appends a line to the current path.
The line is defined by the end point of the path and a point that depends on the specified parameter. The X parameter specifies the x-coordinate of the end point of the line. HLineTo adds the end point of the line to the Points array. The end point of the line is moved horizontally from the last point of the path to the point with the x-coordinate equal to X. The added point is of type LineTo. To move the start point of the line, call MoveTo or MoveToRel before calling HLineTo.
To find the end point of the path, call the LastPoint method.
Appends a line to the current path.
The line is defined by the end point of the path and a point that depends on the specified parameter. The X parameter specifies the distance to the end point of the current path on the x-axis. HLineToRel adds the end point of the line to the Points array. The end point of the line is moved horizontally by a distance equal to X to the end point of the path. The added point is of type LineTo. To move the start point of the line, call MoveTo or MoveToRel before calling HLineToRel.
To find the end point of the path, call the LastPoint method.
IsOutlineVisiblePathPoint(Single,Single)
Overloaded. Determines whether a specified point touches the outline of this path when the path is drawn by the owner canvas.
This method determines whether the test point touches the path outline that would be drawn by the owner canvas.pen. More points will touch an outline drawn by a wide pen than will touch an outline drawn by a narrow pen. The test is done in device coordinates.
IsOutlineVisiblePathPoint(Single,Single,TRSGPPen,TRSGPCanvas)
Overloaded. Determines whether a specified point touches the outline of this path when the path is drawn by a specified canvas and a specified pen.
This method determines whether the test point touches the path outline that would be drawn by the pen. More points will touch an outline drawn by a wide pen than will touch an outline drawn by a narrow pen. The aCanvas parameter specifies a world-to-device transformation. If the value of this parameter is nil, the test is done in world coordinates; otherwise, the test is done in device coordinates.
IsOutlineVisiblePathPoint(TPointF)
Overloaded. Determines whether a specified point touches the outline of this path when the path is drawn by the owner canvas.
This method determines whether the test point touches the path outline that would be drawn by the owner canvas.pen. More points will touch an outline drawn by a wide pen than will touch an outline drawn by a narrow pen. The test is done in device coordinates.
IsOutlineVisiblePathPoint(TPointF,TRSGPPen,TRSGPCanvas)
Overloaded. Determines whether a specified point touches the outline of this path when the path is drawn by a specified canvas and a specified pen.
This method determines whether the test point touches the path outline that would be drawn by the pen. More points will touch an outline drawn by a wide pen than will touch an outline drawn by a narrow pen. The aCanvas parameter specifies a world-to-device transformation. If the value of this parameter is nil, the test is done in world coordinates; otherwise, the test is done in device coordinates.
IsVisiblePathPoint(Single,Single)
Overloaded. Determines whether a specified point lies in the area that is filled when this path is filled by the Owner Canvas.
The test is performed in device coordinates.
IsVisiblePathPoint(Single,Single,TRSGPCanvas)
Overloaded. Determines whether a specified point lies in the area that is filled when this path is filled by the aCanvas parameter.
The aCanvas parameter specifies a world-to-device transformation. If the value of this parameter is nil, the test is done in world coordinates; otherwise, the test is done in device coordinates.
Overloaded. Determines whether a specified point lies in the area that is filled when this path is filled by the Owner Canvas.
The test is performed in device coordinates.
IsVisiblePathPoint(TPointF,TRSGPCanvas)
Overloaded. Determines whether a specified point lies in the area that is filled when this path is filled by the aCanvas parameter.
The aCanvas parameter specifies a world-to-device transformation. If the value of this parameter is nil, the test is done in world coordinates; otherwise, the test is done in device coordinates.
Returns an object for generating enumerators for the TRSGPPathPointKinds in the path
Gets the ending point of the last figure in this path.
Overloaded. Appends a line to the current path.
The line is defined by the end point of the path and a specified point. The x1, y1 parameters specify the end point of the line to be added. To move the start point of the line, call MoveTo or MoveToRel before calling LineTo. LineTo adds P to Points. The added point is of type LineTo.
To find the end point of the path, call the LastPoint method.
Overloaded. Appends a line to the current path.
The line is defined by the end point of the path and a specified point. The P parameter specifies the end point of the line to be added. To move the start point of the line, call MoveTo or MoveToRel before calling LineTo. LineTo adds P to Points. The added point is of type LineTo.
To find the end point of the path, call the LastPoint method.
Appends a line to the current path.
The line is defined by the end point of the path and a point that depends on the point specified by the parameter. The P parameter's coordinates specify the distances to the last point of the current path, on each axis. LineToRel adds the end point of the line to the Points array. Its coordinates are equal to the sum between the coordinates of the last point and the coordinates of P. The added point is of type LineTo. To move the start point of the line, call MoveTo or MoveToRel before calling LineToRel.
To find the end point of the path, call the LastPoint method.
Call this method to force the TRSGPPath object to reload the path from GDI+
Overloaded. Adds a specified point to the end of the current path.
Use MoveTo to customize the start point for a new element to be added to the current path.
The x1, y1 parameters specify the coordinates of the point to be added. MoveTo adds the specified point to a Points array. The added point is of type MoveTo.
When a path is drawn on a canvas, a MoveTo point and the previous point are not visibly connected (no line is drawn between them).
To find the last point of the path, call the LastPoint method.
Overloaded. Adds a specified point to the end of the current path.
Use MoveTo to customize the start point for a new element to be added to the current path.
The P parameter specifies the TPointF to be added. MoveTo adds the specified point to a Points array. The added point is of type MoveTo.
When a path is drawn on a canvas, a MoveTo point and the previous point are not visibly connected (no line is drawn between them).
To find the last point of the path, call the LastPoint method.
Appends a specified TpointF to the current path.
MoveToRel customizes the start point for new elements to be added to the current path.
The P parameter's coordinates specify the distances to the end point of the current path, on each axis. MoveToRel adds a new point to the Points array. Its coordinates are equal to the sum between the coordinates of the last point and the coordinates of P. The added point is of type MoveTo.
The added point is the new start point of the element to be added to the path. When a path is drawn on a canvas, a MoveTo point and the previous point are not visibly connected (no line is drawn between them).
To find the last point of the path, call the LastPoint method.
Called when the Canvas is releasing control of the graphics object. The canvas will no longer be responsible for freeing the graphics object. (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
Flattens the path and then converts the path's data points so that they represent only the outline of the path.
The Flatness parameter specifies the maximum permitted error between the curve and its flattened approximation. By default, it is 0.25. Reducing the flatness value will increase the number of line segments in the approximation.
Prepare the graphics object for drawing. Graphics objects respond in this method to upcoming calls. For example, gradient brushes can make sure the gradient will cover the entire rectangle. (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
Represents method QueryInterface(TGUID,Void). (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
Releases the underlying GDI+ object back to the GDI+ library. (Overrides RSGdiPlusGraphics.TRSGPGraphicsObject.ReleaseHandle.)
Represents method Reload.
Reverses the order of the points that define this path's lines and curves.
Scales the current path by the delta in X and Y. If dx, dy are > 1, the path gets bigger.
Sets the path to use the path data (points and kinds)
SmoothCurveTo(TPointF,TPointF)
Appends a smooth curve to the current path.
The smooth curve is defined by 4 points:
• A start point--the last point of the path.
• Two control points. If Points has more than two items, the first control point coincides with the start point of the curve, otherwise it is equal to the second control point. The Control2 parameter specifies the second control point.
• An end point, specified by the EndPoint parameter.
SmoothCurveTo adds the control points and the end point of the curve to the Points array. The added point is of type CurveTo. To move the start point of the line, call MoveTo or MoveToRel before calling SmoothCurveTo.
To find the end point of the path, call the LastPoint method.
SmoothCurveToRel(TPointF,TPointF)
Appends a smooth curve to the current path.
The smooth curve is defined by 4 points that depend on the last point of the current:
• A start point--the last point of the path.
• If Points has more than 2 items, the first control point coincides with the start point, otherwise it is equal to the second control point. The ControlPoint2 parameter's coordinates specify the distances to the last point of the current path, on each axis, for the second control point of the curve.
• The EndPoint parameter's coordinates specify the distances to the last point of the current path, on each axis, for the end point of the curve.
SmoothCurveToRel adds the control points and the end point of the curve to the Points array. The added point is of type CurveTo. The coordinates for each point are equal to the sum between the coordinates of the last point of the current path and the coordinates of the corresponding points specified by the parameters. To move the start point of the line, call MoveTo or MoveToRel before calling SmoothCurveToRel.
To find the end point of the path, call the LastPoint method.
Starts a new figure without closing the current figure. Subsequent points added to this path are added to the new figure.
Translates the current path by the delta in X and Y. dX and dY are in path units.
Update native graphics object (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
Returns an object for generating enumerators for the points in the path
Appends a line to the current path.
The line is defined by the end point of the path and a point that depends on the specified parameter. The Y parameter specifies the y-coordinate of the end point of the line. VLineTo adds the end point of the line to the Points array. The end point of the line is moved vertically from the last point of the path to the point with the Y-coordinate equal to Y. The added point is of type LineTo. To move the start point of the line, call MoveTo or MoveToRel before calling VLineTo. The added point is of type LineTo.
To find the end point of the path, call the LastPoint method.
Appends a line to the current path.
The line is defined by the end point of the path and a point that depends on the specified parameter. The Y parameter specifies the distance to the end point of the current path on the y-axis. VLineToRel adds the end point of the line to the Points array. The end point of the line is moved vertically by a distance equal to Y to the end point of the path. The added point is of type LineTo. To move the start point of the line, call MoveTo or MoveToRel before calling VLineToRel.
To find the end point of the path, call the LastPoint method.
Replaces this path with curves that enclose the area that is filled when this path is drawn by the owner canvas' pen. The Widen method also flattens the path.
The Flatness parameter specifies the maximum permitted error between the curve and its flattened approximation. By default, it is 0.25. Reducing the flatness value will increase the number of line segments in the approximation.
Represents method _AddRef. (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
Represents method _Release. (Inherited from RSGdiPlusGraphics.TRSGPGraphicsObject.)
|
Reference |