Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Public Sub StretchBitMap(hDestDC As Long, lDestX As Long, lDestY As Long, lDestW As Long, lDestH As Long, hSourceDC As Long, lSourceW As Long, lSourceH As Long)
'This stretches source bitmap
'The only difference between this and BitBltItNow is the lSourceW, lSourceH arguments
'If they are larger than lDestW, lDestH the bitmap will be stretched
'If they are smaller than lDestW, lDestH the bitmap will be shrunk
Public Sub TransTileToForm(hDestDC As Long, lDestW As Long, lDestH As Long, hSourceDC As Long, lSourceW As Long, lSourceH As Long, lTransColor As Long)
'Same thing as TileToForm except that it calls TransBltNow instead of a basic BitBlt
Public Sub TransBltNow(hDestDC As Long, lDestX As Long, lDestY As Long, lWidth As Long, lHeight As Long, hSourceDC As Long, lSourceX As Long, lSourceY As Long, lTransColor As Long)
' This function copies a bitmap from one device context to the other
' where every pixel in the source bitmap that matches the specified color
' becomes transparent, letting the destination bitmap show through.
Dim lOldColor As Long
Dim hMaskDC As Long
Dim hMaskBmp As Long
Dim hOldMaskBmp As Long
Dim hTempBmp As Long
Dim hTempDC As Long
Dim hOldTempBmp As Long
Dim hDummy As Long
Dim lRet As Long
' The Background colors of Source and Destination DCs must
' be the transparancy color in order to create a mask.
lOldColor = SetBkColor&(hSourceDC, lTransColor)
lOldColor = SetBkColor&(hDestDC, lTransColor)
' The mask DC must be compatible with the destination dc,
' but the mask has to be created as a monochrome bitmap.
' For this reason, we create a compatible dc and bitblt
' the mono mask into it.
' Create the Mask DC, and a compatible bitmap to go in it.