初始化畫(huà)刷函數(shù):
BOOL
CreateHatchBrush( int nIndex, COLORREF crColor );

nIndex

Specifies the hatch style of the brush. It can be any one of the following values:

  • HS_BDIAGONAL   Downward hatch (left to right) at 45 degrees    //反斜線(xiàn)
  • HS_CROSS   Horizontal and vertical crosshatch         //正交叉網(wǎng)格    
  • HS_DIAGCROSS   Crosshatch at 45 degrees      //斜交叉網(wǎng)格
  • HS_FDIAGONAL   Upward hatch (left to right) at 45 degrees   //正斜線(xiàn)
  • HS_HORIZONTAL   Horizontal hatch            //水平線(xiàn)
  • HS_VERTICAL   Vertical hatch                  //垂直線(xiàn) 

創(chuàng)建位圖畫(huà)刷:

BOOL CreatePatternBrush( CBitmap* pBitmap );

Return Value

Nonzero if successful; otherwise 0.

Parameters

pBitmap

Identifies a bitmap.

/*CBitmap bm;
 bm.LoadBitmap (IDB_BITMAP1);
 CBrush br;
 br.CreatePatternBrush (&bm);
*/