mGPlus API Reference
v1.4.0
A MiniGUI component which provides support for advanced 2D graphics functions
|
Functions | |
MGPLUS_EXPORT HPATH | MGPlusPathCreate (MPFillMode brushMode) |
Create a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathDelete (HPATH path) |
Delete the HPATH. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathReset (HPATH path) |
Reset the path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathSetAllOrientation (HPATH path, MPOrientation orientation) |
Set all path orientation. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathGetVertex (HPATH path, int idx, double *x, double *y, int *cmd) |
Get the special idx vertex of the path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathGetPointCount (HPATH path, int *count) |
Get the key points count of the path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathGetPoints (HPATH path, int *count, MPPOINT **pt) |
Get the key points coor of the path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddLine (HPATH path, float x1, float y1, float x2, float y2) |
Add a line to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddLineI (HPATH path, int x1, int y1, int x2, int y2) |
Add a line to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddLines (HPATH path, const MPPOINT *points, int count) |
Add a series lines to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddArc (HPATH path, float cx, float cy, float rx, float ry, float startAngle, float sweepAngle) |
Add a arc to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddArcI (HPATH path, int cx, int cy, int rx, int ry, int startAngle, int sweepAngle) |
Add a arc to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddBezier (HPATH path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) |
Add a bezier to the path . More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddBezierI (HPATH path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) |
Add a bezier to the path . More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddRoundRectEx (HPATH path, int x, int y, int width, int height, int rx, int ry) |
Add a round rect to the path . More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathArcto (HPATH path, double x1, double y1, double x2, double y2, double radius) |
Add a arc to a path and two tangent line of arc. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathArctoI (HPATH path, int x1, int y1, int x2, int y2, int radius) |
Add a arc to a path and two tangent line through subpath last vectors, (x1, y1), (x2, y2). More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathMoveto (HPATH path, float x, float y) |
Move the path to a new point. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathMovetoI (HPATH path, int x, int y) |
Move the path to a new point. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathLineto (HPATH path, float x, float y) |
Line the path to a new point. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathLinetoI (HPATH path, int x, int y) |
Line the path to a new point. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathBezierto (HPATH path, float x1, float y1, float x2, float y2, float x3, float y3) |
Add a bezier curve to the last vector. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathBeziertoI (HPATH path, int x1, int y1, int x2, int y2, int x3, int y3) |
Add a bezier curve to the last vector. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathQuadraticto (HPATH path, float x1, float y1, float x2, float y2) |
Add a quadratic curve to the last vector. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathQuadratictoI (HPATH path, int x1, int y1, int x2, int y2) |
Add a quadratic curve to the last vector. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddRectangle (HPATH path, float x, float y, float width, float height) |
Add a rectangle to the path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddRectangleI (HPATH path, int x, int y, int width, int height) |
Add a rectangle to the path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddEllipse (HPATH path, float cx, float cy, float rx, float ry, BOOL clockwise) |
Add a ellipse to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddEllipseI (HPATH path, int cx, int cy, int rx, int ry, BOOL clockwise) |
Add a ellipse to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddCurve (HPATH path, const MPPOINT *points, int count) |
Add a curve to a path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathAddPath (HPATH path, HPATH add_path) |
copy a path to the other path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathStartFigure (HPATH path) |
Add a new sub path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathCloseFigure (HPATH path) |
Close the current sub path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathRotateAroundPoint (HPATH path, const MPPOINT *pt, float angle) |
Transform the special path to rotating around the point. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathSetTransform (HPATH path, MPMatrix *matrix) |
Set the transform matrix to the special path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathGetTransform (HPATH path, MPMatrix *matrix) |
Get the special path's transform matrix . More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathResetTransform (HPATH path) |
Reset the transform matrix of the special path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathScale (HPATH path, float sx, float sy) |
Scale the special path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathRotate (HPATH path, float angle) |
Scale the special path. More... | |
MGPLUS_EXPORT MPStatus | MGPlusPathTranslate (HPATH path, float dx, float dy) |
Scale the special path. More... | |
MGPlus maintains some path defines and operations
MPStatus MGPlusPathAddArc | ( | HPATH | path, |
float | cx, | ||
float | cy, | ||
float | rx, | ||
float | ry, | ||
float | startangle, | ||
float | sweepangle | ||
) |
Add a arc to a path.
This function adds a arc to a path.
path | The path pointer. |
cx | The x position of the center of ellipse that contains the arc. |
cy | The y position of the center of ellipse that contains the arc. |
rx | The x-radius of the ellipse. |
ry | The y-radius of the ellipse. |
startangle | The start angle. |
sweepangle | The specifies the angle, between the starting point (startangle) |
MPStatus MGPlusPathAddArcI | ( | HPATH | path, |
int | cx, | ||
int | cy, | ||
int | rx, | ||
int | ry, | ||
int | startangle, | ||
int | sweepangle | ||
) |
Add a arc to a path.
This function adds a arc to a path.
path | The path pointer. |
cx | The x position of the center of ellipse that contains the arc. |
cy | The y position of the center of ellipse that contains the arc. |
rx | The x-radius of the ellipse. |
ry | The y-radius of the ellipse. |
startangle | The start angle. |
sweepangle | The specifies the angle, between the starting point(startangle) |
MPStatus MGPlusPathAddBezier | ( | HPATH | path, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3, | ||
float | x4, | ||
float | y4 | ||
) |
Add a bezier to the path .
This function adds a bezier to the path.
path | The path pointer. |
x1 | The start x of bezier. |
y1 | The start y of bezier. |
x2 | The first control x of bezier. |
y2 | The first control y of bezier. |
x3 | The second control x of bezier. |
y3 | The second control y of bezier. |
x4 | The end x of bezier. |
y4 | The end y of bezier. |
MPStatus MGPlusPathAddBezierI | ( | HPATH | path, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | x3, | ||
int | y3, | ||
int | x4, | ||
int | y4 | ||
) |
Add a bezier to the path .
This function adds a bezier to the path.
path | The path pointer. |
x1 | The start x of bezier. |
y1 | The start y of bezier. |
x2 | The first control x of bezier. |
y2 | The first control y of bezier. |
x3 | The second control x of bezier. |
y3 | The second control y of bezier. |
x4 | The end x of bezier. |
y4 | The end y of bezier. |
Add a curve to a path.
This function adds a curve to a path.
path | The path pointer. |
points | The points pointer. |
count | The points count. |
MPStatus MGPlusPathAddEllipse | ( | HPATH | path, |
float | cx, | ||
float | cy, | ||
float | rx, | ||
float | ry, | ||
BOOL | clockwise | ||
) |
Add a ellipse to a path.
This function adds a ellipse to a path.
path | The path pointer. |
cx | The x position of the center of the ellipse. |
cy | The y position of the center of the ellipse. |
rx | The x-radius of the ellipse. |
ry | The y-radius of the ellipse. |
clockwise | The direction, if TRUE, it is clockwise, else counter-clockwise. |
Add a ellipse to a path.
This function adds a ellipse to a path.
path | The path pointer. |
cx | The x position of the center of the ellipse. |
cy | The y position of the center of the ellipse. |
rx | The x-radius of the ellipse. |
ry | The y-radius of the ellipse. |
clockwise | The direction if TRUE, it is clockwise, else counter-clockwise. |
Add a line to a path.
This function adds a line to a path.
path | The path pointer. |
x1 | The start x of the line. |
y1 | The start y of the line. |
x2 | The end x of the line. |
y2 | The end y of the line. |
Add a line to a path.
This function adds a line to a path.
path | The path pointer. |
x1 | The start x of the line. |
y1 | The start y of the line. |
x2 | The end x of the line. |
y2 | The end y of the line. |
Add a series lines to a path.
This function adds a series lines to a path.
path | The path pointer. |
points | The points pointer. |
count | The number of points. |
copy a path to the other path.
This function copies a path to the other path.
path | The dst path pointer. |
add_path | The src path pointer. |
Add a rectangle to the path.
This function adds a rectangle to the path.
path | The MGPlusPath pointer. |
x | The left x of the rectangle. |
y | The top y of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
Add a rectangle to the path.
This function adds a rectangle to the path.
path | The path pointer. |
x | The left x of the rectangle. |
y | The top y of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
MPStatus MGPlusPathAddRoundRectEx | ( | HPATH | path, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | rx, | ||
int | ry | ||
) |
Add a round rect to the path .
This function adds a bezier to the path.
path | The path pointer. |
x | The left x of the rectangle. |
y | The top y of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
rx | The radius width of round rect arc. |
ry | The radius height of round rect arc. |
MPStatus MPStatus MGPlusPathArcto | ( | HPATH | path, |
double | x1, | ||
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | radius | ||
) |
Add a arc to a path and two tangent line of arc.
This function add a arc to a path and two tangent line of arc, first line through subpath last vectors to (x1, y1), second line through one arc point to (x2, y2). supported by mGPlus V1.2.1 or upper.
------—(last vector) -— (x1,y1) -— (point of tangent).
arc |(point of tangent). | | (x2,y2)
path | The path pointer. |
x1 | The x coordinat of first point . |
y1 | The y coordinat of first point . |
x2 | The x coordinat of second point . |
y2 | The y coordinat of second point . |
radius | The arc radius. |
Add a arc to a path and two tangent line through subpath last vectors, (x1, y1), (x2, y2).
This function add a arc to a path and two tangent line through subpath last vectors, (x1, y1), (x2, y2), supported by mGPlus V1.2.1 or upper.
path | The path pointer. |
x1 | The x coordinat of first point . |
y1 | The y coordinat of first point . |
x2 | The x coordinat of second point . |
y2 | The y coordinat of second point . |
radius | The arc radius. |
MPStatus MGPlusPathBezierto | ( | HPATH | path, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
Add a bezier curve to the last vector.
This function adds a bezier curve to the last vector, supported by mGPlus V1.2.1 or upper.
path | The MGPlusPath pointer. |
x1 | The first control point x coordinate. |
y1 | The first control point y coordinate. |
x2 | The second control point x coordinate. |
y2 | The second control point y coordinate. |
x3 | The last point x coordinate. |
y3 | The last point y coordinate. |
Add a bezier curve to the last vector.
This function adds a bezier curve to the last vector, supported by mGPlus V1.2.1 or upper.
path | The MGPlusPath pointer. |
x1 | The first control point x coordinate. |
y1 | The first control point y coordinate. |
x2 | The second control point x coordinate. |
y2 | The second control point y coordinate. |
x3 | The last point x coordinate. |
y3 | The last point y coordinate. |
Close the current sub path.
This function closes the current sub path.
path | The path pointer. |
HPATH MGPlusPathCreate | ( | MPFillMode | brushMode | ) |
Create a path.
This function creates a path, and return the HPATH.
brushMode | The path filled mode. |
Delete the HPATH.
This function deletes the path.
path | The path need to be deleted. |
Get the key points count of the path.
This function gets the key points count of the path.
path | The path pointer. |
count | The path count pointer. |
Get the key points coor of the path.
This function gets the key points coor of the path.
path | The path pointer. |
count | The path count pointer. |
pt | The path point coor pointer. |
Get the special path's transform matrix .
This funciton gets the special path's transform matrix, supported by mGPlus V1.2.1 or upper.
path | The path. |
matrix | The translate matrix. |
Get the special idx vertex of the path.
This function gets the key points count of the path.
path | The path pointer. |
idx | The vertex idx. |
x | The pointer of get vertex's x coord . |
y | The pointer of get vertex's y coord . |
cmd | The vertex cmd type of point. |
Line the path to a new point.
This function lines the path to a new point.
path | The MGPlusPath pointer. |
x | The left x of the point. |
y | The top y of the point. |
Line the path to a new point.
This function lines the path to a new point.
path | The MGPlusPath pointer. |
x | The left x of the point. |
y | The top y of the point. |
Move the path to a new point.
This function moves the path to a new point.
path | The MGPlusPath pointer. |
x | The left x of the point. |
y | The top y of the point. |
Move the path to a new point.
This function moves the path to a new point.
path | The MGPlusPath pointer. |
x | The left x of the point. |
y | The top y of the point. |
Add a quadratic curve to the last vector.
This function adds a quadratic curve to the last vector supported by mGPlus V1.2.1 or upper.
path | The MGPlusPath pointer. |
x1 | The control point x coordinate. |
y1 | The control point y coordinate. |
x2 | The last point x coordinate. |
y2 | The last point y coordinate. |
Add a quadratic curve to the last vector.
This function adds a quadratic curve to the last vector supported by mGPlus V1.2.1 or upper.
path | The MGPlusPath pointer. |
x1 | The control point x coordinate. |
y1 | The control point y coordinate. |
x2 | The last point x coordinate. |
y2 | The last point y coordinate. |
Reset the path.
This function resets the path.
path | The path need to be reset. |
Reset the transform matrix of the special path.
path | The operate path. |
Scale the special path.
path | path. |
angle | The rotation angle. |
Transform the special path to rotating around the point.
path | The path. |
pt | The translate center point. |
angle | The the rotation angle. |
Scale the special path.
path | The operate path. |
sx | The x scaling factor. |
sy | The y scaling factor. |
MPStatus MGPlusPathSetAllOrientation | ( | HPATH | path, |
MPOrientation | orientation | ||
) |
Set all path orientation.
This function set all path orientation.
path | The path need to be set. |
orientation | The path direction. |
Set the transform matrix to the special path.
path | The path. |
matrix | The translate matrix. |
Add a new sub path.
This function adds a new sub path.
path | The path pointer. |