获取短划线样式
#Include <GDIPlus.au3>
_GDIPlus_PenGetDashStyle($hPen)
$hPen | 画笔对象句柄 |
成功: | 短线样式: |
$GDIP_DASHSTYLESOLID - 实心线 | |
$GDIP_DASHSTYLEDASH - 短线 | |
$GDIP_DASHSTYLEDOT - 点线 | |
$GDIP_DASHSTYLEDASHDOT - 线-点交替直线 | |
$GDIP_DASHSTYLEDASHDOTDOT - 线-点-点交替直线 | |
$GDIP_DASHSTYLECUSTOM - 用户定义的短线状直线 | |
失败: | 返回-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)
; 显示笔短划线样式
MsgBox(4096, "信息", "Pen dash style: " & _GDIPlus_PenGetDashStyle($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