Ich habe mir mal die GDI+ Funktion _GDIPlus_HatchBrushCreate() näher angeschaut. Man kann den Pinsel jetzt mit 53 Muster füllen lassen!
Nichts besonderes, aber erwähnenswert:
Spoiler anzeigen
;Coded by UEZ 2009.12.06
#include <GDIplus.au3>
Opt("GUIOnEventMode", 1)
_GDIPlus_Startup()
Global $width = @DesktopWidth * 0.75
Global $height = @DesktopHeight * 0.75
Global $hwnd = GUICreate("GDI+: Filled Brushes by UEZ", $width, $height, -1, -1, Default)
GUISetOnEvent(-3, "_Exit")
GUISetState()
Global $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
_GDIPlus_GraphicsSetSmoothingMode($graphics, 4)
Global $brush[53]
For $i = 0 To UBound($brush) - 1
$brush[$i] = _GDIPlus_HatchBrushCreate($i, 0xFF0000FF, 0xFFFFFFFF)
Next
$dx = Int($width /
$dy = Int($height / 7)
_GDIPlus_GraphicsClear($graphics, 0xFF000000)
[/autoit] [autoit][/autoit] [autoit]$k = 0
For $i = 0 To $height -1 Step $dy
For $j = 0 To $width - 1 Step $dx
If $k <= UBound($brush) -1 Then _GDIPlus_GraphicsFillEllipse($graphics, $j, $i, $dx, $dy, $brush[$k])
$k += 1
Next
Next
While Sleep(150)
WEnd
Func _Exit()
For $i = 0 To UBound($brush) - 1
_GDIPlus_BrushDispose($brush[$i])
Next
_GDIPlus_GraphicsDispose($graphics)
_GDIPlus_Shutdown()
Exit
EndFunc
Func _GDIPlus_HatchBrushCreate($iHatchStyle = 0, $iARGBForeground = 0xFFFFFFFF, $iARGBBackground = 0xFFFFFFFF)
Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateHatchBrush", "int", $iHatchStyle, "uint", $iARGBForeground, "uint", $iARGBBackground, "int*", 0)
If @error Then Return SetError(@error, @extended, 0)
Return SetError($aResult[0], 0, $aResult[4])
EndFunc ;==>_GDIPlus_HatchBrushCreate
Viel Spaß und schönen Nikolaus!
UEZ