#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $g_idMemo
Example()
Func Example()
Local $hBrush1, $hBrush2
; 创建 GUI
GUICreate("GDI+ UDF 示例", 400, 300)
$g_idMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL)
GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
GUISetState(@SW_SHOW)
; 创建画刷
_GDIPlus_Startup()
$hBrush1 = _GDIPlus_BrushCreateSolid()
$hBrush2 = _GDIPlus_BrushClone($hBrush1)
; 显示画刷信息
MemoWrite("画刷 1 句柄 : 0x" & Hex($hBrush1))
MemoWrite("画刷 1 类型 ..: " & _GDIPlus_BrushGetType($hBrush1))
MemoWrite("画刷 2 句柄 : 0x" & Hex($hBrush2))
MemoWrite("画刷 2 类型 ..: " & _GDIPlus_BrushGetType($hBrush2))
; 清理资源
_GDIPlus_BrushDispose($hBrush2)
_GDIPlus_BrushDispose($hBrush1)
_GDIPlus_Shutdown()
; 循环到用户退出.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>Example
; 写脚本运行消息到备忘录
Func MemoWrite($sMessage = '')
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite
#include <GDIPlus.au3>#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $g_idMemo
Example()
Func Example()
Local $hBrush1, $hBrush2
; 创建 GUI
GUICreate("GDI+ UDF 示例", 400, 300)
$g_idMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL)
GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
GUISetState(@SW_SHOW)
; 创建画刷
_GDIPlus_Startup()
$hBrush1 = _GDIPlus_BrushCreateSolid()
$hBrush2 = _GDIPlus_BrushClone($hBrush1)
; 显示画刷信息
MemoWrite("画刷 1 句柄 : 0x" & Hex($hBrush1))
MemoWrite("画刷 1 类型 ..: " & _GDIPlus_BrushGetType($hBrush1))
MemoWrite("画刷 2 句柄 : 0x" & Hex($hBrush2))
MemoWrite("画刷 2 类型 ..: " & _GDIPlus_BrushGetType($hBrush2))
; 清理资源
_GDIPlus_BrushDispose($hBrush2)
_GDIPlus_BrushDispose($hBrush1)
_GDIPlus_Shutdown()
; 循环到用户退出.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>Example
; 写脚本运行消息到备忘录
Func MemoWrite($sMessage = '')
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite
|