Function Reference


_GDIPlus_HatchBrushCreate

Creates a HatchBrush object based on a hatch style, a foreground color, and a background color

#include <GDIPlus.au3>
_GDIPlus_HatchBrushCreate ( [$iHatchStyle = 0 [, $iARGBForeground = 0xFFFFFFFF [, $iARGBBackground = 0xFFFFFFFF]]] )

Parameters

$iHatchStyle [optional] Pattern of hatch lines that will be used, see remarks. Default = $GDIP_HATCHSTYLE_HORIZONTAL (0).
$iARGBForeground [optional] Alpha, Red, Green and Blue components of the hatch lines
$iARGBBackground [optional] Alpha, Red, Green and Blue components of the hatch background

Return Value

Success: a pointer to a new HatchBrush object.
Failure: 0 and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3).

Remarks

The pattern constants are declared in GDIPlusConstants.au3, those that start with $GDIP_HATCHSTYLE_*.
When you are done with the HatchBrush object, call _GDIPlus_BrushDispose() to release the resources.

Related

_GDIPlus_BrushDispose

See Also

Search GdipCreateHatchBrush in MSDN Library.

Example

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>

Example()

Func Example()
        Local $hBrush, $iX, $iY

        ; Create GUI
        Local $hGUI = GUICreate("GDI+", 810, 610)
        GUISetState(@SW_SHOW)

        _GDIPlus_Startup()
        Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle

        For $i = 0 To 52
                $iX = 10 + Mod($i, 10) * 80
                $iY = 30 + Floor($i / 10) * 100
                _GDIPlus_GraphicsDrawString($hGraphic, $i, $iX, $iY - 16)

                $hBrush = _GDIPlus_HatchBrushCreate($i, 0xFF00FF00, 0xFF0000FF)
                _GDIPlus_GraphicsFillRect($hGraphic, $iX, $iY, 70, 70, $hBrush)

                _GDIPlus_BrushDispose($hBrush)
        Next

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE

        ; Clean up resources
        _GDIPlus_GraphicsDispose($hGraphic)
        _GDIPlus_Shutdown()
EndFunc   ;==>Example