Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, _
ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc _
As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, _
ByVal crColor As Long) As Long
Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc _
As Long) As Long
Declare Function CreateBitmap Lib "gdi32" (ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount _
As Long, lpBits As Any) As Long
Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As _
Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) _
As Long
Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, _
ByVal hObject As Long) As Long
Public Sub TransparentBlt(DstDC As Long, _
SrcDC As Long, ByVal SrcX As Integer, ByVal SrcY As Integer, _
ByVal SrcW As Integer, ByVal SrcH As Integer, DstX As Integer, _
DstY As Integer, TransColor As Long)
' DstDC - Device context into image is actually drawn
' SrcDC - Device context of source to be made transparent in color TransColor
' SrcX, SrcY, SrcW, SrcH - Rectangular region of source bitmap in pixels
' DstX, DstY - Coordinates in OutDstDC where the transparent bitmap must go
' TransColor - Transparent color
Dim nRet As Long
Dim MonoMaskDC As Long, hMonoMask As Long
Dim MonoInvDC As Long, hMonoInv As Long
Dim ResultDstDC As Long, hResultDst As Long
Dim ResultSrcDC As Long, hResultSrc As Long
Dim hPrevMask As Long, hPrevInv As Long
Dim hPrevSrc As Long, hPrevDst As Long
Dim OldBC As Long
Dim OldMode As Integer