Duplique un embout personnalis� de ligne (CustomLineCap)
#include <GDIPlus.au3>
_GDIPlus_CustomLineCapClone ( $hCustomLineCap )
$hCustomLineCap | Handle de l'objet CustomLineCap |
Succ�s: | Retourne le handle de l'objet CustomLineCap clon�. |
�chec: | Retourne 0 et d�finit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*). |
Lorsque vous en avez termin� avec l'objet CustomLineCap, appelez _GDIPlus_CustomLineCapDispose() pour lib�rer les ressources.
Cherchez GdipCloneCustomLineCap dans la Library MSDN.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $hGUI, $hGraphics, $hPath, $hCustomLineCap, $hClonedLineCap, $hPen Local $avPoints[4][2] = [[3],[-15, -15],[0, 0],[15, -15]] ; Initialisation GDI+ _GDIPlus_Startup() ; Cr�e un objet Graphics � partir d'un handle fen�tre $hGUI = GUICreate("_GDIPlus_CustomLineCapCreate Example", 400, 200) GUISetState(@SW_SHOW) $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; D�finit pour l'objet graphique la qualit� de rendu antialiasing _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; Cr�e GraphicsPath et lui ajoute deux lignes. $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddLine2($hPath, $avPoints) ; Cr�e un objet CustomLineCap. $hCustomLineCap = _GDIPlus_CustomLineCapCreate(0, $hPath) ; Cr�e un objet clone de CustomLineCap. $hClonedLineCap = _GDIPlus_CustomLineCapClone($hCustomLineCap) ; Cr�e un objet Pen, attribue l'embout clon� comme embout personnalis�, et trace une ligne. $hPen = _GDIPlus_PenCreate(0xFFFF0000) _GDIPlus_PenSetCustomEndCap($hPen, $hClonedLineCap) _GDIPlus_GraphicsDrawLine($hGraphics, 50, 50, 350, 150, $hPen) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Nettoie _GDIPlus_PenDispose($hPen) _GDIPlus_CustomLineCapDispose($hClonedLineCap) _GDIPlus_CustomLineCapDispose($hCustomLineCap) _GDIPlus_PathDispose($hPath) _GDIPlus_GraphicsDispose($hGraphics) ; Arr�te GDI+ _GDIPlus_Shutdown() EndFunc ;==>Example