Creates a PathGradientBrush object based on an array of points and initializes the wrap mode of the brush
#include <GDIPlus.au3>
_GDIPlus_PathBrushCreate ( $aPoints [, $iWrapMode = 0] )
$aPoints | Array of points that specify the boundary path of the path gradient brush [0][0] - Number of points [1][0] - Point 1 X coordinate [1][1] - Point 1 Y coordinate [2][0] - Point 2 X coordinate [2][1] - Point 2 Y coordinate [n][0] - Point n X coordinate [n][1] - Point n Y coordinate |
$iWrapMode | [optional] Wrap mode that specifies how areas filled with the brush are tiled: 0 - Tiling without flipping 1 - Tiles are flipped horizontally as you move from one tile to the next in a row 2 - Tiles are flipped vertically as you move from one tile to the next in a column 3 - Tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column 4 - No tiling takes place |
Success: | a pointer to a new PathGradientBrush object. |
Failure: | 0 and sets the @error flag to non-zero, @extended may contain GPSTATUS ($GPIP_ERR* see GPIPlusConstants.au3). |
After you are done with the object, call _GDIPlus_BrushDispose() to release the object resources.
Search GdipCreatePathGradient in MSDN Library.
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $hGUI = GUICreate("GDI+", 600, 400)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
_GDIPlus_GraphicsClear($hGraphics, 0xFF000000)
Local $aPoints[4][2] = [[3]]
$aPoints[1][0] = 0
$aPoints[1][1] = 0
$aPoints[2][0] = 100
$aPoints[2][1] = 30
$aPoints[3][0] = 50
$aPoints[3][1] = 80
Local $hBrush = _GDIPlus_PathBrushCreate($aPoints, 3)
_GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFFFF)
Local $aColors[4] = [3]
$aColors[1] = 0xFFFF0000
$aColors[2] = 0xFF00FF00
$aColors[3] = 0xFF0000FF
_GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColors)
_GDIPlus_GraphicsFillRect($hGraphics, 0, 0, 600, 400, $hBrush)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
EndFunc ;==>Example