为32位图标添加透明度
#Include <WinAPIEx.au3>
_WinAPI_AddIconTransparency ( $hIcon [, $iPercent [, $fDelete]] )
$hIcon | 图标句柄 |
$iPercent | [可选参数] A value (in percent) that specifies how much to decrease the values of the alpha channel for the specified icon. If this parameter is 0, the function returns a fully transparent icon. |
$fDelete | [可选参数] Specifies whether to delete the icon after the function is successful, valid values: TRUE - 函数成功返回后删除图标 FALSE - 不删除且必须在使用完毕后指定删除 |
成功: | 返回新建图标句柄 |
失败: | 返回 0并设置@error非0 |
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global Const $STM_SETIMAGE = 0x0172
Global $hIcon = _WinAPI_Create32BitHICON(_WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 1, 32, 32), 1)
GUICreate('MyGUI', 262, 108)
For $i = 0 To 3
GUICtrlCreateIcon('', 0, 30 + 58 * $i, 38, 32, 32)
GUICtrlSendMsg(-1, $STM_SETIMAGE, 1, _WinAPI_AddIconTransparency($hIcon, 100 - 25 * $i))
Next
_WinAPI_DestroyIcon($hIcon)
GUISetState()
Do
Until GUIGetMsg() = -3