>

DrawHelper.h文件参考

#include "mzfcdll.h"

组合类型

struct  GradientButtonColor
 gradient button's color 更多...

宏定义

#define MZ_BLT_TYPE_STRETCH   1
 Blt type:Stretch
#define MZ_BLT_TYPE_TILE   0
 Blt type:Tile
#define MZ_DRAW_GRAD_RECT_H   0x00000001
 draw mode of DrawGradRect(). H: horizontal
#define MZ_DRAW_GRAD_RECT_V   0x00000002
 draw mode of DrawGradRect(). V: vertical
#define MZ_RECT_LEFT_BOTTOM   0x0008
#define MZ_RECT_LEFT_TOP   0x0001
 four corner of a rectangle
#define MZ_RECT_RIGHT_BOTTOM   0x0004
#define MZ_RECT_RIGHT_TOP   0x0002

函数

BOOL MZFC_API BitmapBlt (HDC hdcDst, const RECT *prcDst, HBITMAP hBmp, const RECT *prcSrc=0)
 BitBlt a bitmap
BOOL MZFC_API BitmapTransBlt (HDC hdcDst, const RECT *prcDst, HBITMAP hBmp, const RECT *prcSrc, COLORREF clrKey)
 Draw COLORKEY bitmap
void MZFC_API CenterRect (const RECT *prcRef, __inout RECT *prcDst)
 calculate & center an rectangle with another: put prcDst at the center of prcRef
void MZFC_API ClearCachedRoundMaskBitmaps ()
 clear the cached Mask bitmaps
HBITMAP CreateRoundMaskBitmap (int nRadius)
void MZFC_API DrawBmpRoundRect2 (HDC hdcDst, RECT *rect, const RECT copyRECT, int nRadius, HDC hbmp, RECT rcBmp, COLORREF bkCr, COLORREF crTrans)
void MZFC_API DrawColorLine (HDC hdcDst, int x1, int y1, int x2, int y2, COLORREF clr)
 draw a line with color
void MZFC_API DrawGradientBg_SilverWhite_480 (HDC hdcDst, const RECT *prcDst, int xOffset)
void MZFC_API DrawGradientBg_SilverWhite_720 (HDC hdcDst, const RECT *prcDst, int xOffset)
BOOL MZFC_API DrawGradRect (HDC hdcDst, const RECT *prcDst, COLORREF cr1, COLORREF cr2, ULONG ulMode)
 draw and fill gradient rectangle
BOOL MZFC_API DrawGradRect2 (HDC hdcDst, const RECT *prcDst, COLORREF cr1, COLORREF cr2, COLORREF cr3, COLORREF cr4, ULONG ulMode)
 draw and fill gradient rectangle (two gradient with four colors)
void MZFC_API DrawGradRoundButton (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF cr1, COLORREF cr2, COLORREF cr3, COLORREF cr4)
 draw round corner button with two gradient
void MZFC_API DrawGradRoundRect (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF cr1, COLORREF cr2, COLORREF crTrans)
 draw round corner rectangle with one gradient
void MZFC_API DrawGradRoundRect2 (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF cr1, COLORREF cr2, COLORREF cr3, COLORREF cr4, COLORREF crTrans)
 draw round corner rectangle with two gradient
void MZFC_API DrawGradRoundRect_Bottom (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF cr1, COLORREF cr2, COLORREF crTrans)
 draw gradient rectangle: bottom side is round corner
void MZFC_API DrawGradRoundRect_Top (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF cr1, COLORREF cr2, COLORREF crTrans)
 draw gradient rectangle: top side is round corner
BOOL MZFC_API DrawRect (HDC hdcDst, const RECT *prcDst, COLORREF clrPen, COLORREF clrBrush)
 Draw rectangle
void MZFC_API DrawRoundRect (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF crPen, COLORREF crBrush)
 draw round corner rectangle
void MZFC_API DrawRoundRect_Bottom (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF crPen, COLORREF crBrush)
 draw rectangle: bottom side is round corner
void MZFC_API DrawRoundRect_Top (HDC hdcDst, const RECT *prcDst, int nRadius, COLORREF crPen, COLORREF crBrush)
 draw rectangle: top side is round corner
HBITMAP MZFC_API GetRoundMaskBitmap (int nRadius)
 get a round Mask bitmap
BOOL MZFC_API MzBlt (HDC hdcDst, const RECT *prcDst, HDC hdcSrc, const RECT *prcSrc, int nBltType=MZ_BLT_TYPE_TILE, int nEdgeLeft=0, int nEdgeRight=0, int nEdgeTop=0, int nEdgeBottom=0, bool bUseAlphaBlend=true)
 Copy the source DC using Tile or Stretch ( horizontally or vertically)
BOOL MZFC_API MzBlt_H (HDC hdcDst, const RECT *prcDst, HDC hdcSrc, const RECT *prcSrc, int nBltType=MZ_BLT_TYPE_TILE, int nEdge1=0, int nEdge2=0, bool bUseAlphaBlend=true)
 Copy the source DC using Tile or Stretch ( horizontally only )
BOOL MZFC_API MzBlt_V (HDC hdcDst, const RECT *prcDst, HDC hdcSrc, const RECT *prcSrc, int nBltType=MZ_BLT_TYPE_TILE, int nEdge1=0, int nEdge2=0, bool bUseAlphaBlend=true)
 Copy the source DC using Tile or Stretch ( vertically only )
void MZFC_API UnLoadGradientBgResource ()
 clear cached resources of the Gradient BG

宏定义文档

#define MZ_BLT_TYPE_STRETCH   1

Blt type:Stretch

#define MZ_BLT_TYPE_TILE   0

Blt type:Tile

#define MZ_DRAW_GRAD_RECT_H   0x00000001

draw mode of DrawGradRect(). H: horizontal

#define MZ_DRAW_GRAD_RECT_V   0x00000002

draw mode of DrawGradRect(). V: vertical

#define MZ_RECT_LEFT_BOTTOM   0x0008

#define MZ_RECT_LEFT_TOP   0x0001

four corner of a rectangle

#define MZ_RECT_RIGHT_BOTTOM   0x0004

#define MZ_RECT_RIGHT_TOP   0x0002


函数文档

BOOL MZFC_API BitmapBlt ( HDC  hdcDst,
const RECT *  prcDst,
HBITMAP  hBmp,
const RECT *  prcSrc = 0 
)

BitBlt a bitmap

BOOL MZFC_API BitmapTransBlt ( HDC  hdcDst,
const RECT *  prcDst,
HBITMAP  hBmp,
const RECT *  prcSrc,
COLORREF  clrKey 
)

Draw COLORKEY bitmap

void MZFC_API CenterRect ( const RECT *  prcRef,
__inout RECT *  prcDst 
)

calculate & center an rectangle with another: put prcDst at the center of prcRef

void MZFC_API ClearCachedRoundMaskBitmaps (  ) 

clear the cached Mask bitmaps

HBITMAP CreateRoundMaskBitmap ( int  nRadius  ) 

void MZFC_API DrawBmpRoundRect2 ( HDC  hdcDst,
RECT *  rect,
const RECT  copyRECT,
int  nRadius,
HDC  hbmp,
RECT  rcBmp,
COLORREF  bkCr,
COLORREF  crTrans 
)

void MZFC_API DrawColorLine ( HDC  hdcDst,
int  x1,
int  y1,
int  x2,
int  y2,
COLORREF  clr 
)

draw a line with color

void MZFC_API DrawGradientBg_SilverWhite_480 ( HDC  hdcDst,
const RECT *  prcDst,
int  xOffset 
)

void MZFC_API DrawGradientBg_SilverWhite_720 ( HDC  hdcDst,
const RECT *  prcDst,
int  xOffset 
)

BOOL MZFC_API DrawGradRect ( HDC  hdcDst,
const RECT *  prcDst,
COLORREF  cr1,
COLORREF  cr2,
ULONG  ulMode 
)

draw and fill gradient rectangle

gradient from color 1 to color 2

参数:
hdcDst [in] destinate DC
prcDst [in] destinate rectangle
cr1 [in] color 1
cr2 [in] color 2
ulMode [in] draw mode, MZ_DRAW_GRAD_RECT_H, MZ_DRAW_GRAD_RECT_V
返回:
TURE: success; FALSE: failed
参见:
DrawGradRect2

BOOL MZFC_API DrawGradRect2 ( HDC  hdcDst,
const RECT *  prcDst,
COLORREF  cr1,
COLORREF  cr2,
COLORREF  cr3,
COLORREF  cr4,
ULONG  ulMode 
)

draw and fill gradient rectangle (two gradient with four colors)

参数:
hdcDst [in] destinate DC
prcDst [in] destinate rectangle
cr1 [in] upper color 1
cr2 [in] upper color 2
cr3 [in] lower color 1
cr4 [in] lower color 2
ulMode [in] draw mode, MZ_DRAW_GRAD_RECT_H, MZ_DRAW_GRAD_RECT_V
返回:
TURE: success; FALSE: failed
参见:
DrawGradRect2

void MZFC_API DrawGradRoundButton ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  cr1,
COLORREF  cr2,
COLORREF  cr3,
COLORREF  cr4 
)

draw round corner button with two gradient

参数:
hdcDst [in] destinate DC
prcDst [in] destinate rectangle
cr1 [in] upper color 1
cr2 [in] upper color 2
cr3 [in] lower color 1
cr4 [in] lower color 2
nRadius [in] the radius of the corner

void MZFC_API DrawGradRoundRect ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  cr1,
COLORREF  cr2,
COLORREF  crTrans 
)

draw round corner rectangle with one gradient

参数:
hdcDst [in] destinate DC
prcDst [in] destinate rectangle
cr1 [in] gradient color 1
cr2 [in] gradient color 2
nRadius [in] the radius of the corner
crTrans [in] transparent color

void MZFC_API DrawGradRoundRect2 ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  cr1,
COLORREF  cr2,
COLORREF  cr3,
COLORREF  cr4,
COLORREF  crTrans 
)

draw round corner rectangle with two gradient

void MZFC_API DrawGradRoundRect_Bottom ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  cr1,
COLORREF  cr2,
COLORREF  crTrans 
)

draw gradient rectangle: bottom side is round corner

void MZFC_API DrawGradRoundRect_Top ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  cr1,
COLORREF  cr2,
COLORREF  crTrans 
)

draw gradient rectangle: top side is round corner

BOOL MZFC_API DrawRect ( HDC  hdcDst,
const RECT *  prcDst,
COLORREF  clrPen,
COLORREF  clrBrush 
)

Draw rectangle

参数:
hdcDst [in] destinate DC
prcDst [in] destinate rectangle
clrPen line color of the rectangle
clrBrush fill color of the rectangle

void MZFC_API DrawRoundRect ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  crPen,
COLORREF  crBrush 
)

draw round corner rectangle

参数:
hdcDst [in] destinate DC
prcDst [in] destinate rectangle
nRadius [in] the radius of the corner
crPen line color of the rectangle
crBrush fill color of the rectangle

void MZFC_API DrawRoundRect_Bottom ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  crPen,
COLORREF  crBrush 
)

draw rectangle: bottom side is round corner

void MZFC_API DrawRoundRect_Top ( HDC  hdcDst,
const RECT *  prcDst,
int  nRadius,
COLORREF  crPen,
COLORREF  crBrush 
)

draw rectangle: top side is round corner

HBITMAP MZFC_API GetRoundMaskBitmap ( int  nRadius  ) 

get a round Mask bitmap

the created mask bitmap will be cached, you could call ClearCachedRoundMaskBitmaps() to clear them

BOOL MZFC_API MzBlt ( HDC  hdcDst,
const RECT *  prcDst,
HDC  hdcSrc,
const RECT *  prcSrc,
int  nBltType = MZ_BLT_TYPE_TILE,
int  nEdgeLeft = 0,
int  nEdgeRight = 0,
int  nEdgeTop = 0,
int  nEdgeBottom = 0,
bool  bUseAlphaBlend = true 
)

Copy the source DC using Tile or Stretch ( horizontally or vertically)

参数:
hdcDst destinate DC
prcDst destinate rectangle
hdcSrc source DC
prcSrc source rectangle
nBltType Blt type (Tile: MZ_BLT_TYPE_TILE,Stretch: MZ_BLT_TYPE_STRETCH)
nEdgeLeft left edge's size
nEdgeRight right edge's size
nEdgeTop top edge's size
nEdgeBottom bottom edge's size
bUseAlphaBlend whether use AlphaBlend to Blt

BOOL MZFC_API MzBlt_H ( HDC  hdcDst,
const RECT *  prcDst,
HDC  hdcSrc,
const RECT *  prcSrc,
int  nBltType = MZ_BLT_TYPE_TILE,
int  nEdge1 = 0,
int  nEdge2 = 0,
bool  bUseAlphaBlend = true 
)

Copy the source DC using Tile or Stretch ( horizontally only )

参数:
hdcDst destinate DC
prcDst destinate rectangle
hdcSrc source DC
prcSrc source rectangle
nBltType Blt type (Tile: MZ_BLT_TYPE_TILE,Stretch: MZ_BLT_TYPE_STRETCH)
nEdge1 left edge's size
nEdge2 right edge's size
bUseAlphaBlend whether use AlphaBlend to Blt

BOOL MZFC_API MzBlt_V ( HDC  hdcDst,
const RECT *  prcDst,
HDC  hdcSrc,
const RECT *  prcSrc,
int  nBltType = MZ_BLT_TYPE_TILE,
int  nEdge1 = 0,
int  nEdge2 = 0,
bool  bUseAlphaBlend = true 
)

Copy the source DC using Tile or Stretch ( vertically only )

参数:
hdcDst destinate DC
prcDst destinate rectangle
hdcSrc source DC
prcSrc source rectangle
nBltType Blt type (Tile: MZ_BLT_TYPE_TILE,Stretch: MZ_BLT_TYPE_STRETCH)
nEdge1 top edge's size
nEdge2 bottom edge's size
bUseAlphaBlend whether use AlphaBlend to Blt

void MZFC_API UnLoadGradientBgResource (  ) 

clear cached resources of the Gradient BG


Generated at Fri Feb 20 15:17:30 2009 for Meizu M8 MZFC Documentation by 魅族手机