函数参考


_GDIPlus_ArrowCapCreate

创建高度和宽度可调的箭头线帽

#Include <GDIPlus.au3>
_GDIPlus_ArrowCapCreate($fHeight, $fWidth [, $bFilled = True])

参数

$fHeight 指定箭头基线到端点的单位长度
$fWidth 指定箭头基线高度
$bFilled [可选参数] 填充标志:
 True - 箭头将被填充
False - 箭头不会填充

返回值

成功: 返回新建箭头帽对象句柄
失败: 返回 0

注意/说明

当对象处理完后, 调用_GDIPlus_ArrowCapDispo释放对象资源.

相关

_GDIPlus_ArrowCapDispose

详情参考

在MSDN中搜索


示例/演示


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

_Main()

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

    ; 创建 GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState()

    ; 创建资源
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hPen = _GDIPlus_PenCreate(0xFF000000, 2)
    $hEndCap = _GDIPlus_ArrowCapCreate(3, 6)
    _GDIPlus_PenSetCustomEndCap($hPen, $hEndCap)

    ; 显示笔端盖
    MsgBox(4096, "信息", "Pen end cap: 0x" & Hex(_GDIPlus_PenGetCustomEndCap($hPen)))

    ; 描绘箭头
    _GDIPlus_GraphicsDrawLine($hGraphic, 10, 120, 390, 120, $hPen)
    _GDIPlus_PenSetWidth($hPen, 4)
    _GDIPlus_GraphicsDrawLine($hGraphic, 10, 150, 390, 150, $hPen)
    _GDIPlus_PenSetWidth($hPen, 6)
    _GDIPlus_GraphicsDrawLine($hGraphic, 10, 180, 390, 180, $hPen)

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; 清理资源
    _GDIPlus_ArrowCapDispose($hEndCap)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>_Main