Function Reference


_GDIPlus_PenSetDashStyle

Sets the pen dash style

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

Parameters

$hPen Handle to a pen object
$iStyle [optional] Dash style. Can be one of the following:
    $GDIP_DASHSTYLESOLID - A solid line
    $GDIP_DASHSTYLEDASH - A dashed line
    $GDIP_DASHSTYLEDOT - A dotted line
    $GDIP_DASHSTYLEDASHDOT - An alternating dash-dot line
    $GDIP_DASHSTYLEDASHDOTDOT - An alternating dash-dot-dot line
    $GDIP_DASHSTYLECUSTOM - A a user-defined, custom dashed line

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).

Related

_GDIPlus_PenGetDashStyle

See Also

Search GdipSetPenDashStyle in MSDN Library.

Example

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

Example()

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

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

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

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

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

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

        ; Clean up resources
        _GDIPlus_PenDispose($hPen)
        _GDIPlus_GraphicsDispose($hGraphic)
        _GDIPlus_Shutdown()
EndFunc   ;==>Example