mGPlus API Reference  v1.4.0
A MiniGUI component which provides support for advanced 2D graphics functions
Functions
Brush

Functions

MGPLUS_EXPORT HBRUSH MGPlusBrushCreate (MPBrushType type)
 Create a brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusBrushDelete (HBRUSH brush)
 Delete a brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetSolidBrushColor (HBRUSH brush, ARGB rgba)
 Set color with solid brush. More...
 
MPStatus MGPlusGetSolidBrushColor (HBRUSH brush, ARGB *rgba)
 Set color with solid brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetTextureBrushImage (HBRUSH brush, BITMAP *bitmap)
 Set image with texture brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterPoint (HBRUSH brush, MPPOINT *point)
 Set the center point with path gradient brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterColor (HBRUSH brush, ARGB rgba)
 Set the center point color with path gradient brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundColors (HBRUSH brush, ARGB *rgba, int count)
 Set the surround color with path gradient brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundRect (HBRUSH brush, RECT *rect)
 Set the single color rect with path gradient brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushMode (HBRUSH brush, MPLinearGradientMode mode)
 Set the linear gradient brush mode. More...
 
MGPLUS_EXPORT MPStatus MGPlusGetLinearGradientBrushMode (HBRUSH brush, MPLinearGradientMode *mode)
 Get the linear gradient brush mode. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushRect (HBRUSH brush, RECT *rect)
 Set the rect of the linear gradient brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColors (HBRUSH brush, ARGB *colors, int count)
 Set the start color and end color with the linear gradient brush. More...
 
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColorsEx (HBRUSH brush, ARGB *colors, int count, float *position)
 Set the start color and end color with the linear gradient brush, and every color with position info. More...
 
MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushGetColors (HBRUSH brush, ARGB *color, float *position)
 get the linear gradient brush color. More...
 
MGPLUS_EXPORT int MGPlusLinearGradientBrushGetColorNumber (HBRUSH brush)
 get the linear gradient brush color number. More...
 
MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushAddColor (HBRUSH brush, ARGB color, float position)
 Add the linear gradient brush color. More...
 

Detailed Description

MGPlus maintains some brush defines and operations

Function Documentation

HBRUSH MGPlusBrushCreate ( MPBrushType  type)

Create a brush.

This function creates a brush.

Parameters
typeThe MPBrushType type.
Returns
, INVALID_HANDLE indicates an error.
See also
MGPlusBrushDelete
MPStatus MGPlusBrushDelete ( HBRUSH  brush)

Delete a brush.

This function deletes a brush.

Parameters
brushThe bursh pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
See also
MGPlusBrushCreate
MPStatus MGPlusGetLinearGradientBrushMode ( HBRUSH  brush,
MPLinearGradientMode mode 
)

Get the linear gradient brush mode.

This function gets the linear gradient brush mode.

Parameters
brushThe bursh pointer.
modeThe linear gradient mode pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
See also
MGPlusSetLinearGradientBrushMode
MPStatus MGPlusGetSolidBrushColor ( HBRUSH  brush,
ARGB rgba 
)

Set color with solid brush.

This function sets color with solid brush.

Parameters
brushThe bursh pointer.
rgbaThe color pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MGPlusLinearGradientBrushAddColor ( HBRUSH  brush,
ARGB  color,
float  position 
)

Add the linear gradient brush color.

This function adds the linear gradient brush color, supported by mGPlus V1.2.1 or upper.

Parameters
brushThe bursh pointer.
colorThe linear graidnet brush's color.
positionThe linear gradient brush's color position info.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MGPlusLinearGradientBrushGetColorNumber ( HBRUSH  brush)

get the linear gradient brush color number.

This function get the linear gradient brush color number, supported by mGPlus V1.2.1 or upper.

Parameters
brushThe bursh pointer.
Returns
Get Gradient color number.
MPStatus MGPlusLinearGradientBrushGetColors ( HBRUSH  brush,
ARGB color,
float *  position 
)

get the linear gradient brush color.

This function get the linear gradient brush color, supported by mGPlus V1.2.1 or upper.

Parameters
brushThe bursh pointer.
colorThe input linear graidnet brush's color array pointer.
positionThe input linear graidnet brush's position array pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MGPlusSetLinearGradientBrushColors ( HBRUSH  brush,
ARGB colors,
int  count 
)

Set the start color and end color with the linear gradient brush.

This function set the start color and end color with the linear gradient brush.

Parameters
brushThe bursh pointer.
colorsThe linear graidnet brush's color pointer.
countThe number of linear gradient brush's colors.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MGPlusSetLinearGradientBrushColorsEx ( HBRUSH  brush,
ARGB colors,
int  count,
float *  position 
)

Set the start color and end color with the linear gradient brush, and every color with position info.

This function set the start color and end color with the linear gradient brush.

Parameters
brushThe bursh pointer.
colorsThe linear graidnet brush's color pointer.
countThe number of linear gradient brush's colors.
positionThe position info of linear gradient brush's colors.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusSetLinearGradientBrushMode ( HBRUSH  brush,
MPLinearGradientMode  mode 
)

Set the linear gradient brush mode.

This function sets the linear gradient brush mode.

Parameters
brushThe bursh pointer.
modeThe linear gradient mode.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
See also
MGPlusGetLinearGradientBrushMode
MPStatus MGPlusSetLinearGradientBrushRect ( HBRUSH  brush,
RECT *  rect 
)

Set the rect of the linear gradient brush.

This function set the rect of the linear gradient brush.

Parameters
brushThe bursh pointer.
rectThe linear gradient brush valid rect pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusSetPathGradientBrushCenterColor ( HBRUSH  brush,
ARGB  rgba 
)

Set the center point color with path gradient brush.

This function sets the center point color with path gradient brush.

Parameters
brushThe bursh pointer.
rgbaThe center point color.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
See also
MGPlusSetPathGradientBrushCenterPoint
MPStatus MGPlusSetPathGradientBrushCenterPoint ( HBRUSH  brush,
MPPOINT point 
)

Set the center point with path gradient brush.

This function sets the center point with path gradient brush.

Parameters
brushThe bursh pointer.
pointThe center point pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
See also
MGPlusSetPathGradientBrushCenterColor
MPStatus MGPlusSetPathGradientBrushSurroundColors ( HBRUSH  brush,
ARGB rgba,
int  count 
)

Set the surround color with path gradient brush.

This function sets the center point color with path gradient brush.

Parameters
brushThe bursh pointer.
rgbaThe surround points color.
countThe surround color number.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
See also
MGPlusSetPathGradientBrushCenterColor
MPStatus MGPlusSetPathGradientBrushSurroundRect ( HBRUSH  brush,
RECT *  rect 
)

Set the single color rect with path gradient brush.

This function sets the single color rect with path gradient brush.

Parameters
brushThe bursh pointer.
rectThe rect pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
See also
MGPlusSetPathGradientBrushCenterColor
MPStatus MGPlusSetSolidBrushColor ( HBRUSH  brush,
ARGB  rgba 
)

Set color with solid brush.

This function sets color with solid brush.

Parameters
brushThe bursh pointer.
rgbaThe color.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusSetTextureBrushImage ( HBRUSH  brush,
BITMAP *  bitmap 
)

Set image with texture brush.

This function sets image with texture brush.

Parameters
brushThe bursh pointer.
bitmapThe BITMAP pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.