Hey,

I'm create a project and I want to alphablend 2 DirectX surfaces together, using MSIMG32.DLL's AlphaBlend function.

This is what I have:

(the declare)
Code:
Private Declare Function ABlend Lib "Alphablending.dll" Alias "AlphaBlending" (ByVal destHDC As Long, ByVal XDest As Long, ByVal YDest As Long, ByVal destWidth As Long, ByVal destHeight As Long, ByVal srcHDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal srcWidth As Long, ByVal srcHeight As Long, ByVal AlphaSource As Long) As Long
AlphaBlending.dll is just a simplified call to the MSIMG32 alphablend, so it's parameters are easier to use :P

and the code:

Code:
    Dim hn1 As Long, hn2 As Long
    hn1 = DDSS.GetDC
    hn2 = BackBuffer.GetDC
    ABlend hn2, dRect.Left, dRect.Top, dRect.Right - dRect.Left, dRect.Bottom - dRect.Top, hn1, 0, 0, dRect.Right - dRect.Left - 1, dRect.Bottom - dRect.Top - 1, (255 / 2)
    DDSS.ReleaseDC hn1
    Backbuffer.ReleaseDC hn2
I get an error on the ReleaseDC code... ideas??

Thanks alot!