#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local $hGUI, $hGraphic, $hBrush, $hRegion, $hRegion1, $hRegion2, $hPath
; Create GUI
$hGUI = GUICreate("Form1", @DesktopWidth+5, @DesktopHeight+50, -1, -1,$WS_POPUP,$WS_EX_TOPMOST)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
_GDIPlus_GraphicsClear($hGraphic, 0x00000000)
$hBrush1 = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$hBrush2 = _GDIPlus_BrushCreateSolid(0xFFFFFF00)
$hBrush3 = _GDIPlus_BrushCreateSolid(0xFF6666FF)
$hBrush4 = _GDIPlus_BrushCreateSolid(0xFF00CC00)
$hBrush5 = _GDIPlus_BrushCreateSolid(0xFFCC33FF)
$hBrush6 = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$hBrush7 = _GDIPlus_BrushCreateSolid(0xFF0000FF)
$hBrush8 = _GDIPlus_BrushCreateSolid(0xFF000000)
$hRegion1 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*0, 0, @DesktopWidth/8, @DesktopHeight+50)
$hRegion2 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*1, 0, @DesktopWidth/8, @DesktopHeight+50)
$hRegion3 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*2, 0, @DesktopWidth/8, @DesktopHeight+50)
$hRegion4 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*3, 0, @DesktopWidth/8, @DesktopHeight+50)
$hRegion5 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*4, 0, @DesktopWidth/8, @DesktopHeight+50)
$hRegion6 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*5, 0, @DesktopWidth/8, @DesktopHeight+50)
$hRegion7 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*6, 0, @DesktopWidth/8, @DesktopHeight+50)
$hRegion8 = _GDIPlus_RegionCreateFromRect(@DesktopWidth/8*7, 0, @DesktopWidth/8, @DesktopHeight+50)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion1, $hBrush1)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion2, $hBrush2)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion3, $hBrush3)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion4, $hBrush4)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion5, $hBrush5)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion6, $hBrush6)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion7, $hBrush7)
_GDIPlus_GraphicsFillRegion($hGraphic, $hRegion8, $hBrush8)
_GDIPlus_GraphicsDrawString($hGraphic, "Press ESC To EXIT.", 50, @DesktopHeight-10)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_RegionDispose($hRegion1)
_GDIPlus_RegionDispose($hRegion2)
_GDIPlus_RegionDispose($hRegion3)
_GDIPlus_RegionDispose($hRegion4)
_GDIPlus_RegionDispose($hRegion5)
_GDIPlus_RegionDispose($hRegion6)
_GDIPlus_RegionDispose($hRegion7)
_GDIPlus_RegionDispose($hRegion8)
_GDIPlus_BrushDispose($hBrush1)
_GDIPlus_BrushDispose($hBrush2)
_GDIPlus_BrushDispose($hBrush3)
_GDIPlus_BrushDispose($hBrush4)
_GDIPlus_BrushDispose($hBrush5)
_GDIPlus_BrushDispose($hBrush6)
_GDIPlus_BrushDispose($hBrush7)
_GDIPlus_BrushDispose($hBrush8)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>Example