找回密码
 加入
搜索
查看: 1941|回复: 2

能给我注释一下面函数吗,偶看不太懂

  [复制链接]
发表于 2008-8-30 08:21:23 | 显示全部楼层 |阅读模式
Func SetBitmap($hGUI, $hImage, $iOpacity)
        Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
        $hScrDC= _WinAPI_GetDC(0)
        $hMemDC= _WinAPI_CreateCompatibleDC($hScrDC)
        $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
        $hOld= _WinAPI_SelectObject($hMemDC, $hBitmap)
        $tSize = DllStructCreate($tagSIZE)
        $pSize = DllStructGetPtr($tSize)
        DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth ($hImage))
        DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
        $tSource = DllStructCreate($tagPOINT)
        $pSource = DllStructGetPtr($tSource)
        $tBlend= DllStructCreate($tagBLENDFUNCTION)
        $pBlend= DllStructGetPtr($tBlend)
        DllStructSetData($tBlend, "Alpha" , $iOpacity)
        DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
        _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
        _WinAPI_ReleaseDC (0, $hScrDC)
        _WinAPI_SelectObject($hMemDC, $hOld)
        _WinAPI_DeleteObject($hBitmap)
        _WinAPI_DeleteDC($hMemDC)
        _GDIPlus_ShutDown ()
EndFunc
发表于 2008-8-30 08:43:50 | 显示全部楼层
获得当前的设备上下文,在上面绘制一个图像并设置alpha通道透明……
你不必看得懂,只要会用就行了。
 楼主| 发表于 2008-8-30 08:56:32 | 显示全部楼层

回复 2# asdf 的帖子

偶想活用它,当然得看明白是什么意思,要不然稀理糊涂了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-24 20:55 , Processed in 0.074371 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表