试试 msimg32.dll 的 AlphaBlend() 有冇搞头
程序代码:
DECLARE long GetDC IN user32 long DECLARE long ReleaseDC IN user32 long,long DECLARE long LoadImage IN user32 long,string,long,long,long,long DECLARE long CreateCompatibleDC IN gdi32 long DECLARE long GetBitmapDimensionEx IN gdi32 long,string@ DECLARE long DeleteDC IN gdi32 long DECLARE long SelectObject IN gdi32 long,long DECLARE long DeleteObject IN gdi32 long DECLARE long AlphaBlend IN msimg32 long,long,long,long,long,long,long,long,long,long,long #define IMAGE_BITMAP 0 #define LR_LOADFROMFILE 0x0010 cFile = "D:\temp\巧克力.bmp" nWidth = 100 nHeight = 140 hdcDest = GetDC(_screen.hWnd) hBitmap = LoadImage(0, cFile, IMAGE_BITMAP, nWidth, nHeight, LR_LOADFROMFILE) IF hBitmap == 0 RETURN ENDIF hdcSrc = CreateCompatibleDC(0) IF hdcSrc == 0 DeleteObject(hBitmap) RETURN ENDIF hObjSrc = SelectObject(hdcSrc, hBitmap) FOR nAlpha=0 TO 255 STEP 17 AlphaBlend(hdcDest, 10, 10, nWidth, nHeight, hdcSrc, 0, 0, nWidth, nHeight, 0x10000*nAlpha) INKEY(0.8) ENDFOR SelectObject(hdcSrc, hObjSrc) DeleteDC(hdcSrc) DeleteObject(hBitmap) ReleaseDC(_screen.hWnd, hdcDest)