Private 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 some groups of constants'
'---------------------------------'
Public Enum ScrollDirection 'These Are Used in the Scroll Direction Property
Right_To_Left = 1
Left_To_Right = 2
Bottom_To_Top = 3
Top_To_Bottom = 4
BottomRight_To_TopLeft = 5
TopLeft_To_BottomRight = 6
TopRight_To_BottomLeft = 7
BottomLeft_To_TopRight = 8
End Enum
Public Enum BitBlt_dwROP 'The Different BitBlt Types
Src_And = &H8800C6
Src_Copy = &HCC0020
Src_Invert = &H660046
Src_Paint = &HEE0086
Src_Erase = &H440328
Not_Src_Copy = &H330008
Not_Src_Erase = &H1100A6
End Enum
'--------------------'
'Dim Some Stuff'
'--------------------'
Dim X As Integer, Y As Integer 'Position Of The Scrolling Image
Dim Back As Integer, Wdth As Integer, Hght As Integer 'Holds Info for The Parents Size
Dim PicWdth As Integer, PicHght As Integer, Direct As Integer ' Holds Info From the Picture to Blt
'Property Variables:
Dim m_BitBltStyle As Variant
Dim m_Direction As ScrollDirection
Dim ExitIt As Boolean ' Tells The Scrolling When To Stop
'Default Property Values:
Const m_def_BitBltStyle = &HCC0020
Const m_def_Direction = 1
Public Sub Stop_Scroll() ' Stop Scrolling
ExitIt = True
End Sub
Public Sub Start_Scroll() 'Start Scrolling
'---------------------'
'Get Some Picture Info'
'---------------------'
PicWdth = Int(Pic.Width / Screen.TwipsPerPixelX)
PicHght = Int(Pic.Height / Screen.TwipsPerPixelY)
Pic.BackColor = UserControl.Parent.BackColor
ExitIt = False
On Error GoTo Nd:
Do 'Start The Loop
For Back = 0 To PicWdth
For Y = -PicHght To Hght Step PicHght ' The Y-Blt Pos
For X = -PicWdth To Wdth Step PicWdth ' The X-Blt Pos