Transforme et aplatit un tracé (GraphicsPath), puis convertit les points de données du tracé de sorte qu'ils ne représentent que le contour du tracé
#include <GDIPlus.au3>
_GDIPlus_PathWindingModeOutline ( $hPath [, $hMatrix = 0 [, $fFlatness = 0.25]] )
$hPath | Handle de l'objet GraphicsPath |
$hMatrix | [optionnel] Handle de l'objet Matrix qui spécifie la transformation. Si 0, aucune transformation n'est appliquée |
$fFlatness | [optionnel] Nombre décimal qui spécifie l'erreur maximale entre le tracé et son approximation aplatie. Une planéité faible augmente le nombre de segments de droite dans l'approximation. |
Succès: | Retourne True. |
Échec: | Retourne False et définit @error <> 0, @extended contient le code erreur ($GPID_ERR*). |
_GDIPlus_PathFlatten, _GDIPlus_PathWarp
Consultez GdipWindingModeOutline dans la Librairie MSDN.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $hGUI, $hGraphic, $hBrush, $hPen, $hPath, $hPath_Clone, $hMatrix ; Crée une GUI $hGUI = GUICreate("GDI+", 800, 400) GUISetState(@SW_SHOW) _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; Crée un objet graphique à partir du handle de la fenêtre _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; Définit pour l'objet graphique la qualité de rendu antialiasing _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hBrush = _GDIPlus_BrushCreateSolid(0x7F8800AA) $hPen = _GDIPlus_PenCreate(0xFF8800AA, 2) $hPath = _GDIPlus_PathCreate() ; Crée un objet path _GDIPlus_PathAddLine($hPath, 106, 330, 200, 40) _GDIPlus_PathAddLine($hPath, 294, 330, 48, 151) _GDIPlus_PathAddLine($hPath, 352, 151, 106, 330) $hPath_Clone = _GDIPlus_PathClone($hPath) ; Créez une copie de la figure $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, 400, 0) _GDIPlus_PathTransform($hPath_Clone, $hMatrix) _GDIPlus_PathWindingModeOutline($hPath_Clone) ; Aperçu _GDIPlus_GraphicsDrawString($hGraphic, "original path of 3 connected lines", 40, 10) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ; Dessine le Path avec le handle Graphic (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ; Dessine le Path avec le handle Graphic (GUI) _GDIPlus_GraphicsDrawString($hGraphic, "WindingModeOutline", 440, 10) _GDIPlus_GraphicsFillPath($hGraphic, $hPath_Clone, $hBrush) ; Dessine le Path avec le handle Graphic (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath_Clone, $hPen) ; Dessine le Path avec le handle Graphic (GUI) ; Boucle jusqu'à ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Nettoie les ressources _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_PathDispose($hPath) _GDIPlus_PathDispose($hPath_Clone) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example