初始化画刷函数:
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    //反斜线
  • HS_CROSS   Horizontal and vertical crosshatch         //正交叉网格    
  • HS_DIAGCROSS   Crosshatch at 45 degrees      //斜交叉网格
  • HS_FDIAGONAL   Upward hatch (left to right) at 45 degrees   //正斜线
  • HS_HORIZONTAL   Horizontal hatch            //水平线
  • HS_VERTICAL   Vertical hatch                  //垂直线 

创建位图画刷:

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);
*/