Graphics

Functions


Detailed Description

MGPlus maintains some graphics defines and operations


Function Documentation

MGPLUS_EXPORT HDC MGPlusGetGraphicDC ( HGRAPHICS  graphic  ) 

Get graphic’s buffer hdc.

This function get graphic’s buffer hdc.

Parameters:
graphic The MGPlusGraphics pointer.
Returns:
HDC if success, else return MP_GENERIC_ERROR.
See also:
MGPlusDeleteGraphics
MPStatus MGPlusGraphicBlend ( HGRAPHICS  src_gs,
HGRAPHICS  dst_gs 
)

Blend between Graphic’s buffer.

This function Blends source MGPlusGraphics from dest MGPlusGraphics.

Parameters:
src_gs The source MGPlusGraphics pointer.
dst_gs The dest MGPlusGraphics pointer.
Returns:
MP_GENERIC_ERROR indicates an error.
See also:
MGPlusDeleteGraphics
MPStatus MGPlusGraphicClearEx ( HGRAPHICS  graphics,
RECT *  rect,
ARGB  color 
)

Use color to clear graphics with the specific rect.

This function uses color to clear graphics with the specific rect, supported by mGPlus V1.2.1 or upper.

Parameters:
graphics The MGPlusGraphics pointer
rect The specific rect
color The clear color
Returns:
Clear Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusDeleteGraphics
MPStatus MGPlusGraphicCopy ( HGRAPHICS  src_gs,
HGRAPHICS  dst_gs 
)

Copy the src graphic to dst.

This function copies the src graphic to dst.

Parameters:
src_gs The source MGPlusGraphics pointer.
dst_gs The dest MGPlusGraphics pointer.
Returns:
MP_GENERIC_ERROR indicates an error.
See also:
MGPlusDeleteGraphics
MPStatus MGPlusGraphicCopyFromDC ( HGRAPHICS  graphic,
HDC  hdc,
int  sx,
int  sy,
int  sw,
int  sh,
int  dx,
int  dy 
)

Copy the hdc content to graphic.

This function copys the hdc content to graphic.

Parameters:
graphic The MGPlusGraphics pointer.
hdc The copy hdc.
sx The x coordinate of the upper-left corner of the rectangle in the source DC.
sy The y coordinate of the upper-left corner of the rectangle in the source DC.
sw The width of the source rectangle.
sh The height of the source rectangle.
dx The x coordinate of the upper-left corner of the rectangle in the destination DC.
dy The y coordinate of the upper-left corner of the rectangle in the destination DC.
See also:
MGPlusDeleteGraphics
HGRAPHICS MGPlusGraphicCreate ( int  width,
int  height 
)

Create graphic.

This function creates MGPlusGraphics from specical size.

Parameters:
width The width of the graphics's surface
height The height of the graphics's surface
Returns:
HGRAPHICS when succeed to create, or else NULL indicates an error.
See also:
MGPlusDeleteGraphics
HGRAPHICS MGPlusGraphicCreateFromDC ( HDC  hdc  ) 

Create Graphic’s buffer through hdc.

This function creates MGPlusGraphics from specical hdc and returns the create status.

Parameters:
hdc The handle of hdc.
Returns:
HGRAPHICS when succeed to create, or NULL indicates an error.
See also:
MGPlusDeleteGraphics
HGRAPHICS MGPlusGraphicCreateWithoutCanvas ( HDC  hdc  ) 

Create graphic from hdc and use hdc's surface as canvas.

This function creates MGPlusGraphics from specical hdc, but use hdc's surface as canvas of thr Graphics.

Parameters:
hdc The handle of hdc.
Returns:
HGRAPHICS when succeed to create, or NULL indicates an error.
See also:
MGPlusDeleteGraphics
MPStatus MGPlusGraphicDelete ( HGRAPHICS  graphics  ) 

Delete the graphic.

This function deletes MGPlusGraphics

Parameters:
graphics The MGPlusGraphics pointer.
Returns:
Delete Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusGraphicsCreate
MPStatus MGPlusGraphicSave ( HGRAPHICS  graphics,
HDC  hdc,
int  sx,
int  sy,
int  sw,
int  sh,
int  dx,
int  dy 
)

Create Graphic’s buffer through hdc.

This function creates MGPlusGraphics from specical pix format and returns the create status.

Parameters:
graphics The MGPlusGraphics pointer.
hdc The dst hdc.
sx The x coordinate of the upper-left corner of the rectangle in the source DC.
sy The y coordinate of the upper-left corner of the rectangle in the source DC.
sw The width of the source rectangle.
sh The height of the source rectangle.
dx The x coordinate of the upper-left corner of the rectangle in the destination DC.
dy The y coordinate of the upper-left corner of the rectangle in the destination DC.
Returns:
Create Status, MP_GENERIC_ERROR indicates an error.
See also:
MGPlusDeleteGraphics
HGRAPHICS MGPlusRestoreHG ( HGRAPHICS  hg,
int  saved_hg 
)

Restore the graphic.

This function restores graphic from saved stack, supported by mGPlus V1.2.1 or upper.

Parameters:
hg The Graphic handle.
saved_hg The save_hg Specifies the saved state to be restored. If this parameter is positive, saved_hg represents a specific instance of the state to be restored. If this parameter is negative, saved_dc represents an instance relative to the current state. For example, -1 restores the most recently saved state.
Returns:
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
See also:
MGPlusSaveHG
MGPLUS_EXPORT int MGPlusSaveHG ( HGRAPHICS  hg  ) 

Save the graphic to stack.

This function saves the graphic to stack, supported by mGPlus V1.2.1 or upper.

Parameters:
hg The Graphic handle.
Returns:
If succee, return states, else return zero.
See also:
MGPlusResotreHG
Generated on Wed Apr 27 09:48:11 2011 for mGPlus V1.2.4 API Reference by  doxygen 1.6.3