Sets the blend factors and the blend positions of a linear gradient brush to create a custom blend
_GDIPlus_LineBrushSetBlend ( $hLineGradientBrush, $aBlends )
|$hLineGradientBrush||Pointer to a LinearGradientBrush object|
|$aBlends||Array of blend factors and blend positions:
 - Number of blend factors and blend positions, must be at least 2
 - Factor 1
 - Position 1
 - Factor 2
 - Position 2
[n] - Factor n
[n] - Position n
|Failure:||False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPID_ERR*).|
Each factor in the array specifies a percentage of the ending color and should be in the range 0.0 to 1.0.
Each position in the array indicates a percentage of the distance between the starting boundary and the ending boundary and is in the range 0.0 to 1.0, where 0.0 indicates the starting boundary of the gradient and 1.0 indicates the ending boundary.
Search GdipSetLineBlend in MSDN Library.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() _GDIPlus_Startup() ;initialize GDI+ Local Const $iWidth = 600, $iHeight = 600, $iBgColor = 0x303030 ;$iBgColor format RRGGBB Local $hGUI = GUICreate("GDI+ Example (" & @ScriptName & ")", $iWidth, $iHeight) ;create a test GUI GUISetBkColor($iBgColor, $hGUI) ;set GUI background color GUISetState(@SW_SHOW) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing) Local $hBrush = _GDIPlus_LineBrushCreate(0, 0, 280, 570, 0xFFFFFF00, 0xFF4020FF, 1) ;create linear gradient flipped brush Local $aBlends $aBlends = 4 ; Using 4 factors and position $aBlends = 0 ; Factor $aBlends = 0 ; Position $aBlends = 1 ; The percentage of the blending is 100% (red to green is gradually completed in just 20% from the left) $aBlends = 0.2 ; The distance percentage from the left boundary of the brush is 20% $aBlends = 0 ; The percentage of the blending is 0% (green to red is gradually completed from 20% to 70% from the left) $aBlends = 0.7 ; The distance percentage from the left boundary of the brush is 70% $aBlends = 1 ; The percentage of the blending is 100% (red to green is gradually completed from 70% to 100% from the left) $aBlends = 1 ; The distance percentage from the left boundary of the brush is 100% _GDIPlus_LineBrushSetBlend($hBrush, $aBlends); set the linear gradient brush color positions and factors _GDIPlus_GraphicsFillEllipse($hGraphics, 100, 50, 380, 500, $hBrush) ;draw the egg Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ;cleanup GDI+ resources _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hGUI) EndFunc ;==>Example