Function _GDIPlus_PathAddLine2

Function Reference


Adds a sequence of lines to the current figure of a path

#include <GDIPlus.au3>
_GDIPlus_PathAddLine2 ( $hPath, $aPoints )


$hPath Pointer to a GraphicsPath object
$aPoints Array of points that define the lines:
    [0][0] - Number of points
    [1][0] - Point 1 X position
    [1][1] - Point 1 Y position
    [2][0] - Point 2 X position
    [2][1] - Point 2 Y position
    [n][0] - Point n X position
    [n][1] - Point n Y position

Return Value

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



See Also

Search GdipAddPathLine2 in MSDN Library.


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


Func Example()
    Local $hGUI, $hGraphics, $hPath, $hCustomLineCap, $hClonedLineCap, $hPen
    Local $avPoints[4][2] = [[3], [-15, -15], [0, 0], [15, -15]]

    ; Initialize GDI+

    ;create a Graphics object from a window handle
    $hGUI = GUICreate("_GDIPlus_CustomLineCapCreate Example", 400, 200)

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)

    ;sets the graphics object rendering quality (antialiasing)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY)

    ; Create GraphicsPath and add two lines to it.
    $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddLine2($hPath, $avPoints)

    ; Create a CustomLineCap object.
    $hCustomLineCap = _GDIPlus_CustomLineCapCreate(0, $hPath)

    ; Create a clone CustomLineCap object.
    $hClonedLineCap = _GDIPlus_CustomLineCapClone($hCustomLineCap)

    ; Create a Pen object, assign cloned cap as the custom end cap, and draw a line.
    $hPen = _GDIPlus_PenCreate(0xFFFF0000)
    _GDIPlus_PenSetCustomEndCap($hPen, $hClonedLineCap)

    _GDIPlus_GraphicsDrawLine($hGraphics, 50, 50, 350, 150, $hPen)

    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up

    ; Uninitialize GDI+
EndFunc   ;==>Example