Remplit un rectangle
#include <GDIPlus.au3>
_GDIPlus_GraphicsFillRect ( $hGraphics, $nX, $nY, $nWidth, $nHeight [, $hBrush = 0] )
$hGraphics | Handle de l'objet Graphics |
$nX | La coordonn�e X du coin sup�rieur gauche du rectangle |
$nY | La coordonn�e Y du coin sup�rieur gauche du rectangle, |
$nWidth | La largeur du rectangle |
$nHeight | La hauteur du rectangle |
$hBrush | [optionnel] Handle de l'objet Brush (pinceau) qui est utilis� pour remplir le rectangle. Si 0, un pinceau noir sera utilis�e. |
Succ�s: | Retourne True. |
�chec: | Retourne False et d�finit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*). |
Consultez GdipFillRectangle dans la Librairie MSDN.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $hGUI, $hGraphic ; Cr�e GUI $hGUI = GUICreate("GDI+", 400, 300) GUISetState(@SW_SHOW) ; Remplit un rectangle _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsFillRect($hGraphic, 10, 10, 100, 100) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Nettoie les ressources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() _GDIPlus_Startup() ; Initialise GDI+ Local Const $iWidth = 600, $iHeight = 600, $iBgColor = 0x303030 ; $iBGColor est au format RRGGBB Local $hGUI = GUICreate("GDI+ example", $iWidth, $iHeight) ; Cr�e une fen�tre de test GUISetBkColor($iBgColor, $hGUI) ; D�finit la couleur de fond de la GUI GUISetState(@SW_SHOW) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; Cr�e un objet Graphics � partir du handle de la fen�tre _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; D�finit pour l'objet graphique la qualit� de rendu antialiasing Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFEE88BB) ; Format de couleur AARRGGBB (hex) _GDIPlus_GraphicsFillRect($hGraphics, 150.5, 50.1, 280.25, 500.75, $hBrush) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Nettoie les ressources GDI+ _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hGUI) EndFunc ;==>Example