# Brush

The Brush structure contains functions and structures to create and operate on brushes. Brushes are used to fill areas of the screen with single colours or patterns.

    structure Brush:
      sig
        type HBITMAP and HBRUSH and HDC

        datatype
          HatchStyle =
              HS_BDIAGONAL
            | HS_CROSS
            | HS_DIAGCROSS
            | HS_FDIAGONAL
            | HS_HORIZONTAL
            | HS_VERTICAL

        datatype
          BrushStyle =
              BS_HATCHED of HatchStyle
            | BS_HOLLOW
            | BS_PATTERN of HBITMAP
            | BS_SOLID

        type COLORREF = Color.COLORREF

        type LOGBRUSH = BrushStyle * COLORREF
        type POINT = {x: int, y: int}
        type RasterOpCode = Bitmap.RasterOpCode

        datatype ColorType =
    		COLOR_SCROLLBAR
    	|	COLOR_BACKGROUND
    	|	COLOR_ACTIVECAPTION
    	|	COLOR_INACTIVECAPTION
    	|	COLOR_MENU
    	|	COLOR_WINDOW
    	|	COLOR_WINDOWFRAME
    	|	COLOR_MENUTEXT
    	|	COLOR_WINDOWTEXT
    	|	COLOR_CAPTIONTEXT
    	|	COLOR_ACTIVEBORDER
    	|	COLOR_INACTIVEBORDER
    	|	COLOR_APPWORKSPACE
    	|	COLOR_HIGHLIGHT
    	|	COLOR_HIGHLIGHTTEXT
    	|	COLOR_BTNFACE
    	|	COLOR_BTNSHADOW
    	|	COLOR_GRAYTEXT
    	|	COLOR_BTNTEXT
    	|	COLOR_INACTIVECAPTIONTEXT
    	|	COLOR_BTNHIGHLIGHT
    	|	COLOR_3DDKSHADOW
    	|	COLOR_3DLIGHT
    	|	COLOR_INFOTEXT
    	|	COLOR_INFOBK

        val CreateBrushIndirect : LOGBRUSH -> HBRUSH
        val CreateHatchBrush : HatchStyle * COLORREF -> HBRUSH
        val CreatePatternBrush : HBITMAP -> HBRUSH
        val CreateSolidBrush : COLORREF -> HBRUSH
        val GetSysColorBrush : ColorType -> HBRUSH
        val GetBrushOrgEx : HDC -> POINT
        val PatBlt : HDC * int * int * int * int * RasterOpCode -> unit
        val SetBrushOrgEx : HDC * POINT -> POINT
      end