' ********************************************************************
' Project : BitBltPrimer.vbp
' Filename : BitBlt.bas
' Description : BitBlt API primer tutorial project
' Created : 11.15 PM GMT + 10.00, February 23, 1998
' Modified : 12:26 AM GMT + 10.00, October 17, 1998
' ********************************************************************
' Author : Michael Lambino
' Comments : Copyright ©, 23 February, 1998, Michael Lambino
' License : Freeware - Freely distributable unmodified.
' : No costs may be charged whatsoever for the
' : distribution of this tutorial, in any form of
' : media, without expressed permission of the author.
' ********************************************************************
' Require all variables be declared.
Option Explicit
' Enumerated raster operation constants
Public Enum RasterOps
'
' Copies the source bitmap to destination bitmap
SRCcopy = &HCC0020
'
' Combines pixels of the destination with source bitmap using
' the Boolean AND operator.
SRCAND = &H8800C6
'
' Combines pixels of the destination with source bitmap using
' the Boolean XOR operator.
SRCinvert = &H660046
'
' Combines pixels of the destination with source bitmap using
' the Boolean OR operator.
SRCpaint = &HEE0086
'
' Inverts the destination bitmap and then combines the results
' with the source bitmap using the Boolean AND operator.
SRCERASE = &H4400328
'
' Turns all output white.
WHITENESS = &HFF0062
'
' Turn output black.
BLACKNESS = &H42
End Enum
' BitBlt API Public Declaration
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 RasterOps _
) As Long
' ********************************************************************
' Parameter descriptions
' ********************************************************************
' ByVal hDestDC As Long : hDC of object (Destination PictureBox hDC)
' : in which resulting Blt operation will
' : performed.
' ----------------------+---------------------------------------------
' ByVal x As Long : Leftmost coordinate (upper-left) of the
' : destination rectangle.
' ----------------------+---------------------------------------------
' ByVal y As Long : Topmost coordinate (upper-left) of the
' : destination rectangle.
' ----------------------+---------------------------------------------
' ByVal nWidth As Long : Width of the rectangle of the destination
' : image to be bltted.
' ----------------------+---------------------------------------------
' ByVal nHeight As Long : height of the rectangle of the destination
' : image to be bltted.
' ----------------------+---------------------------------------------
' ByVal hSrcDC As Long : hDC of object (Source PictureBox hDC) in
' : which resulting Blt operation will be
' : performed from.
' ----------------------+---------------------------------------------
' ByVal xSrc As Long : Leftmost coordinate (upper-left) of the
' : source rectangle.
' ----------------------+---------------------------------------------
' ByVal ySrc As Long : Topmost coordinate (upper-left) of the
' : source rectangle.
' ----------------------+---------------------------------------------
' ByVal dwRop As Long : specifies the raster operation to be
' : performed as above.
' --------------------------------------------------------------------