|
Foxit PDF SDK
|
Public Types | |
| enum | PointType { PointType.e_TypeMoveTo = 1, PointType.e_TypeLineTo = 2, PointType.e_TypeLineToCloseFigure = 3, PointType.e_TypeBezierTo = 4, PointType.e_TypeBezierToCloseFigure = 5 } |
| Enumeration for point type in path. More... | |
Public Member Functions | |
| Path () | |
| Constructor. | |
| Path (Path other) | |
| Constructor, with another path object. More... | |
| bool | AppendEllipse (RectF rect) |
| Add an ellipse figure to the end of current path. More... | |
| bool | AppendRect (RectF rect) |
| Add a rectangle figure to the end of current path. More... | |
| void | Clear () |
| Clear all points. More... | |
| bool | CloseFigure () |
| Close current figure (which is also the last figure in current path). More... | |
| bool | CubicBezierTo (PointF point1, PointF point2, PointF point3) |
| Add a cubic bezier spline to the end of current figure, by three points: two control points and one target point. More... | |
| PointF | GetPoint (int index) |
| Get a point specified by index. More... | |
| int | GetPointCount () |
| Get the count of points. More... | |
| Path.PointType | GetPointType (int index) |
| Get the type of a point specified by index. More... | |
| bool | IsEmpty () |
| Check whether current object is empty or not. More... | |
| bool | LineTo (PointF point) |
| Add a point to the end of current figure, and a line is to be drawn from current point to the new point. More... | |
| bool | MoveTo (PointF point) |
| Add a point to the end of current path, to start a new figure. More... | |
| bool | RemovePoint (int index) |
| Remove a point specified by index. More... | |
| bool | SetPoint (int index, PointF point, Path.PointType type) |
| Change the value and type of a point specified by index. More... | |
| void | Transform (Matrix2D matrix) |
| Transform all points in current path with a given matrix. More... | |
This class represents a path which contains one or more figures.
|
strong |
Enumeration for point type in path.
Values of this enumeration should be used alone.
| Enumerator | |
|---|---|
| e_TypeMoveTo | Indicates that the point is the first point of a figure. |
| e_TypeLineTo | Indicates that a line is drawn from the previous point to this point. |
| e_TypeLineToCloseFigure | Indicates that a line is drawn from the previous point to this point, and this point will also be connected to the nearest foxit.common.Path.PointType.e_TypeMoveTo point before this point, in order to close current figure. |
| e_TypeBezierTo | Indicates that this point is a control point or ending point for a Bezier spline. |
| e_TypeBezierToCloseFigure | Indicates that this point is the ending point for a Bezier spline, and this point will also be connected to the nearest foxit.common.Path.PointType.e_TypeMoveTo point before this point, in order to close current figure. |
|
inline |
Constructor, with another path object.
| [in] | other | Another path object. |
|
inline |
Add an ellipse figure to the end of current path.
| [in] | rect | The enclosing rectangle of an ellipse figure. |
|
inline |
Add a rectangle figure to the end of current path.
| [in] | rect | A rectangle which specifies a rectangle figure. |
|
inline |
Clear all points.
|
inline |
Close current figure (which is also the last figure in current path).
When closing current figure, the last point's type may be changed:
If the last point's type is foxit.common.Path.PointType.e_TypeMoveTo , that means the last figure just has one point and cannot be closed and current function will return false.
If the last point's type is foxit.common.Path.PointType.e_TypeLineTo , the type will be changed to foxit.common.Path.PointType.e_TypeLineToCloseFigure .
If the last point's type is foxit.common.Path.PointType.e_TypeLineTo , the type will be changed to foxit.common.Path.PointType.e_TypeBezierToCloseFigure .
If the last point's type is already foxit.common.Path.PointType.e_TypeLineToCloseFigure or foxit.common.Path.PointType.e_TypeBezierToCloseFigure , that means the last figure has been closed. The type will not be changed and function will still return true.
Add a cubic bezier spline to the end of current figure, by three points: two control points and one target point.
If this function succeeds, parameter point3 will become the new "current point".
| [in] | point1 | New point as the first control point for cubic bezier, in PDF coordinate system. |
| [in] | point2 | New point as the second control point for cubic bezier, in PDF coordinate system. |
| [in] | point3 | New point as target point for cubic bezier, in PDF coordinate system. |
|
inline |
Get a point specified by index.
| [in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path.GetPointCount . |
|
inline |
Get the count of points.
|
inline |
Get the type of a point specified by index.
| [in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path.GetPointCount . |
|
inline |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
|
inline |
Add a point to the end of current figure, and a line is to be drawn from current point to the new point.
If this function succeeds, the new point will become the new "current point".
| [in] | point | New point, in PDF coordinate system. |
|
inline |
Add a point to the end of current path, to start a new figure.
If this function succeeds, the new point will become the new "current point", and the new figure will become the new "current figure".
| [in] | point | New point, in PDF coordinate system. |
|
inline |
Remove a point specified by index.
| [in] | index | The index of the point to be removed. Valid range: 0 to (count-1). count is returned by function Path.GetPointCount . |
|
inline |
Change the value and type of a point specified by index.
| [in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path.GetPointCount . |
| [in] | point | The new point to set, in PDF coordinate system. |
| [in] | type | The type used to set to the new point. Please refer to values starting from foxit.common.Path.PointType.e_TypeMoveTo and this should be one of these values. |
|
inline |
Transform all points in current path with a given matrix.
| [in] | matrix | A matrix used for transforming. |