Path

Functions


Detailed Description

MGPlus maintains some path defines and operations


Function Documentation

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.

Parameters:
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)
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddArcI
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.

Parameters:
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)
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddArc
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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusDrawBezierI
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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusDrawBezier
MPStatus MGPlusPathAddCurve ( HPATH  path,
const MPPOINT points,
int  count 
)

Add a curve to a path.

This function adds a curve to a path.

Parameters:
path The path pointer.
points The points pointer.
count The points count.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddEllipseI
MPStatus MGPlusPathAddEllipseI ( HPATH  path,
int  cx,
int  cy,
int  rx,
int  ry,
BOOL  clockwise 
)

Add a ellipse to a path.

This function adds a ellipse to a path.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddEllipse
MPStatus MGPlusPathAddLine ( HPATH  path,
float  x1,
float  y1,
float  x2,
float  y2 
)

Add a line to a path.

This function adds a line to a path.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddLineI
MPStatus MGPlusPathAddLineI ( HPATH  path,
int  x1,
int  y1,
int  x2,
int  y2 
)

Add a line to a path.

This function adds a line to a path.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddLine
MPStatus MPStatus MGPlusPathAddLines ( HPATH  path,
const MPPOINT points,
int  count 
)

Add a series lines to a path.

This function adds a series lines to a path.

Parameters:
path The path pointer.
points The points pointer.
count The number of points.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusAddPathLine
MPStatus MGPlusPathAddPath ( HPATH  path,
HPATH  add_path 
)

copy a path to the other path.

This function copies a path to the other path.

Parameters:
path The dst path pointer.
add_path The src path pointer.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusPathAddRectangle ( HPATH  path,
float  x,
float  y,
float  width,
float  height 
)

Add a rectangle to the path.

This function adds a rectangle to the path.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddRectangleI
MPStatus MGPlusPathAddRectangleI ( HPATH  path,
int  x,
int  y,
int  width,
int  height 
)

Add a rectangle to the path.

This function adds a rectangle to the path.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathAddRectangle
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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusDrawBezier
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)

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathArctoI
MPStatus 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).

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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathArcto
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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathBeziertoI
MPStatus MGPlusPathBeziertoI ( HPATH  path,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathBezierto
MPStatus MGPlusPathCloseFigure ( HPATH  path  ) 

Close the current sub path.

This function closes the current sub path.

Parameters:
path The path pointer.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathStartFigure
HPATH MGPlusPathCreate ( MPFillMode  brushMode  ) 

Create a path.

This function creates a path, and return the HPATH.

Parameters:
brushMode The path filled mode.
Returns:
If success, it returns the HPATH.
See also:
MGPlusPathDelete
MPStatus MGPlusPathDelete ( HPATH  path  ) 

Delete the HPATH.

This function deletes the path.

Parameters:
path The path need to be deleted.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathCreate
MPStatus MGPlusPathGetPointCount ( HPATH  path,
int *  count 
)

Get the key points count of the path.

This function gets the key points count of the path.

Parameters:
path The path pointer.
count The path count pointer.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusPathGetPoints ( HPATH  path,
int *  count,
MPPOINT **  pt 
)

Get the key points coor of the path.

This function gets the key points coor of the path.

Parameters:
path The path pointer.
count The path count pointer.
pt The path point coor pointer.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusPathGetTransform ( HPATH  path,
MPMatrix matrix 
)

Get the special path's transform matrix .

This funciton gets the special path's transform matrix, supported by mGPlus V1.2.1 or upper.

Parameters:
path The path.
matrix The translate matrix.
Returns:
if success return MP_OK, else return MP_GENERIC_ERROR.
MPStatus MGPlusPathGetVertex ( HPATH  path,
int  idx,
double *  x,
double *  y,
int *  cmd 
)

Get the special idx vertex of the path.

This function gets the key points count of the path.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusPathLineto ( HPATH  path,
float  x,
float  y 
)

Line the path to a new point.

This function lines the path to a new point.

Parameters:
path The MGPlusPath pointer.
x The left x of the point.
y The top y of the point.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathLinetoI
MPStatus MGPlusPathLinetoI ( HPATH  path,
int  x,
int  y 
)

Line the path to a new point.

This function lines the path to a new point.

Parameters:
path The MGPlusPath pointer.
x The left x of the point.
y The top y of the point.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathLineto
MPStatus MGPlusPathMoveto ( HPATH  path,
float  x,
float  y 
)

Move the path to a new point.

This function moves the path to a new point.

Parameters:
path The MGPlusPath pointer.
x The left x of the point.
y The top y of the point.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathMovetoI
MPStatus MGPlusPathMovetoI ( HPATH  path,
int  x,
int  y 
)

Move the path to a new point.

This function moves the path to a new point.

Parameters:
path The MGPlusPath pointer.
x The left x of the point.
y The top y of the point.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathMoveto
MPStatus MGPlusPathQuadraticto ( HPATH  path,
float  x1,
float  y1,
float  x2,
float  y2 
)

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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathQuadratictoI
MPStatus MGPlusPathQuadratictoI ( HPATH  path,
int  x1,
int  y1,
int  x2,
int  y2 
)

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.

Parameters:
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.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathQuadraticto
MPStatus MGPlusPathReset ( HPATH  path  ) 

Reset the path.

This function resets the path.

Parameters:
path The path need to be reset.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusPathResetTransform ( HPATH  path  ) 

Reset the transform matrix of the special path.

Parameters:
path The operate path.
Returns:
if success return MP_OK, else return MP_GENERIC_ERROR.
MPStatus MGPlusPathRotate ( HPATH  path,
float  angle 
)

Scale the special path.

Parameters:
path path.
angle The rotation angle.
Returns:
if success return MP_OK, else return MP_GENERIC_ERROR.
MPStatus MGPlusPathRotateAroundPoint ( HPATH  path,
const MPPOINT pt,
float  angle 
)

Transform the special path to rotating around the point.

Parameters:
path The path.
pt The translate center point.
angle The the rotation angle.
Returns:
if success return MP_OK, else return MP_GENERIC_ERROR.
MPStatus MGPlusPathScale ( HPATH  path,
float  sx,
float  sy 
)

Scale the special path.

Parameters:
path The operate path.
sx The x scaling factor.
sy The y scaling factor.
Returns:
if success return MP_OK, else return MP_GENERIC_ERROR.
MPStatus MGPlusPathSetAllOrientation ( HPATH  path,
MPOrientation  orientation 
)

Set all path orientation.

This function set all path orientation.

Parameters:
path The path need to be set.
orientation The path direction.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusPathSetTransform ( HPATH  path,
MPMatrix matrix 
)

Set the transform matrix to the special path.

Parameters:
path The path.
matrix The translate matrix.
Returns:
If success return MP_OK, else return MP_GENERIC_ERROR.
MPStatus MGPlusPathStartFigure ( HPATH  path  ) 

Add a new sub path.

This function adds a new sub path.

Parameters:
path The path pointer.
Returns:
Get Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusPathCloseFigure
MPStatus MGPlusPathTranslate ( HPATH  path,
float  dx,
float  dy 
)

Scale the special path.

Parameters:
path The path.
dx The dx translation distance.
dy The dy translation distance.
Returns:
if success return MP_OK, else return MP_GENERIC_ERROR.
Generated on Wed Apr 27 09:48:11 2011 for mGPlus V1.2.4 API Reference by  doxygen 1.6.3