本帖最后由 帆船 于 2017-9-9 21:25 编辑 #include <GDIPlus.au3>
Func _Bitmap_SetTransRect($hBitmap, $aRect)
For $Num = $aRect[0][0] To $aRect[0][1]
For $Mum = $aRect[1][0] To $aRect[1][1]
_GDIPlus_BitmapSetPixel($hBitmap, $Num, $Mum, 0x00FFFFFF)
Next
Next
EndFunc ;==>_Bitmap_SetTransRect
Func _Bitmap_SetTransColor($hBitmap, $iColor)
For $Num = 0 To _GDIPlus_ImageGetWidth($hBitmap) - 1
For $Mum = 0 To _GDIPlus_ImageGetHeight($hBitmap) - 1
If _GDIPlus_BitmapGetPixel($hBitmap, $Num, $Mum) = "0xFF" & Hex($iColor, 6) Then
_GDIPlus_BitmapSetPixel($hBitmap, $Num, $Mum, 0x00FFFFFF)
EndIf
Next
Next
EndFunc ;==>_Bitmap_SetTransColor
自用的两个小函数,分别是将指定区域全部透明和指定颜色透明 |