本帖最后由 eaglelin 于 2011-12-8 17:18 编辑
关于
http://www.autoitx.com/thread-29167-1-1.html
里面的问题虽然解决了 GUI没有边框 但是png文件不透明显示 还是有个白底
我曾经看见过站里面有单独显示透明png图片的GUI,用一个叫SetBitmap()的函数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
但是这种函数不可以拉伸png图片
怎么才能创建一个可以拉伸的png图片为背景的GUI? |