Функция _GDIPlus_PenSetEndCap

         Описание функции


_GDIPlus_PenSetEndCap

Sets the pen end cap

#include <GDIPlus.au3>
_GDIPlus_PenSetEndCap($hPen, $iEndCap)

Параметры

$hPen Дескриптор объекта Карандаш
$iEndCap End cap type. Can be one of the following:
    $GDIP_LINECAPFLAT - Specifies a flat cap
    $GDIP_LINECAPSQUARE - Specifies a square cap
    $GDIP_LINECAPROUND - Specifies a circular cap
    $GDIP_LINECAPTRIANGLE - Specifies a triangular cap
    $GDIP_LINECAPNOANCHOR - Specifies that the line ends are not anchored
    $GDIP_LINECAPSQUAREANCHOR - Specifies that the line ends are anchored with a square
    $GDIP_LINECAPROUNDANCHOR - Specifies that the line ends are anchored with a circle
    $GDIP_LINECAPDIAMONDANCHOR - Specifies that the line ends are anchored with a diamond
    $GDIP_LINECAPARROWANCHOR - Specifies that the line ends are anchored with arrowheads
    $GDIP_LINECAPCUSTOM - Specifies that the line ends are made from a CustomLineCap

Возвращаемое значение

Успех:Возвращает True
Ошибка:Возвращает False

См. также

_GDIPlus_PenGetEndCap

См. также

Искать GdipSetPenEndCap в библиотеке MSDN

Пример

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

_Main()

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

    ; Создаёт GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState()

    ; Создаёт ресурсы
    _GDIPlus_Startup ()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
    $hPen = _GDIPlus_PenCreate (0xFF000000, 8)
    _GDIPlus_PenSetEndCap($hPen, $GDIP_LINECAPARROWANCHOR)

    ; Show pen end cap
    MsgBox(4096, "Информация", "Pen end cap type: " & _GDIPlus_PenGetEndCap ($hPen))

    ; Рисует стрелки
    _GDIPlus_GraphicsDrawLine ($hGraphic, 10, 130, 390, 130, $hPen)
    _GDIPlus_PenSetWidth($hPen, 6)
    _GDIPlus_GraphicsDrawLine ($hGraphic, 10, 150, 390, 150, $hPen)
    _GDIPlus_PenSetWidth($hPen, 8)
    _GDIPlus_GraphicsDrawLine ($hGraphic, 10, 170, 390, 170, $hPen)

    ; Цикл выполняется, пока окно не будет закрыто
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Очищает ресурсы
    _GDIPlus_PenDispose ($hPen)
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_ShutDown ()

EndFunc   ;==>_Main