获取短划线线帽样式
#Include <GDIPlus.au3>
_GDIPlus_PenGetDashCap($hPen)
$hPen | 画笔对象句柄 |
成功: | 返回短划线线帽样式: |
$GDIP_DASHCAPFLAT - 两端均为方形线帽 | |
$GDIP_DASHCAPROUND - 两端均为圆形线帽 | |
$GDIP_DASHCAPTRIANGLE - 两端均为三角形线帽 | |
失败: | 返回 -1 并设置@error |
在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_PenSetDashStyle($hPen, $GDIP_DASHSTYLEDASHDOT)
_GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPTRIANGLE)
; 显示笔短划线帽
MsgBox(4096, "信息", "Pen dash cap: " & _GDIPlus_PenGetDashCap($hPen))
; 描绘线条
_GDIPlus_GraphicsDrawLine($hGraphic, 10, 150, 390, 150, $hPen)
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; 清理资源
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>_Main