CreateHatchBrush

Syntax

HBRUSH CreateHatchBrush(nIndex,crColor)

This function creates a logical brush that has the specified hatched pattern and color. The brush can subsequently be selected as the current brush for any device.

Parameter Type/Description  
nIndex int Specifies the hatch style of the brush. It can be any one of the following values:  
  Value Meaning
  HS_BDIAGONAL 45-degree upward hatch (left to right)
  HS_CROSS Horizontal and vertical crosshatch
  HS_DIAGCROSS 45-degree crosshatch
  HS_FDIAGONAL 45-degree downward hatch (left to right)
  HS_HORIZONTAL Horizontal hatch
  HS_VERTICAL Vertical hatch
Parameter Type/Description  
crColor COLORREF Specifies the foreground color of the brush (the color of the hatches).  

Return Value

The return value identifies a logical brush if the function is successful. Otherwise, it is NULL.