Function Reference


Sets the pen dash cap style

#include <GDIPlus.au3>
_GDIPlus_PenSetDashCap ( $hPen [, $iDash = 0] )


$hPen Handle to a pen object
$iDash [optional] Dash cap style. Can be one of the following:
    $GDIP_DASHCAPFLAT - A square cap that squares off both ends of each dash
    $GDIP_DASHCAPROUND - A circular cap that rounds off both ends of each dash
    $GDIP_DASHCAPTRIANGLE - A triangular cap that points both ends of each dash

Return Value

Success: True.
Failure: False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3).



See Also

Search GdipSetPenDashCap197819 in MSDN Library.


#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>


Func Example()
        Local $hGUI, $hGraphic, $hPen

        ; Create GUI
        $hGUI = GUICreate("GDI+", 400, 300)

        ; Create resources
        $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
        $hPen = _GDIPlus_PenCreate(0xFF000000, 8)
        _GDIPlus_PenSetDashStyle($hPen, $GDIP_DASHSTYLEDASHDOT)
        _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPTRIANGLE)

        ; Show pen dash cap
        MsgBox($MB_SYSTEMMODAL, "Information", "Pen dash cap: " & _GDIPlus_PenGetDashCap($hPen))

        ; Draw line
        _GDIPlus_GraphicsDrawLine($hGraphic, 10, 150, 390, 150, $hPen)

        ; Loop until the user exits.
        Until GUIGetMsg() = $GUI_EVENT_CLOSE

        ; Clean up resources
EndFunc   ;==>Example