Private Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
Private Sub Form_Load()
' Set the ScaleMode of both PictureBox controls to
' pixels, the units expected by the BitBlt function.
Picture1.ScaleMode = PIXELS
Picture2.ScaleMode = PIXELS
' Picture2 holds the entire background bitmap. Setting
' AutoSize lets the control resize itself to the same
' dimensions as the bitmap it contains.
Picture2.AutoSize = True
' Setting AutoRedraw to true creates a persistent bitmap,
' which can be BitBlted even if it's not visible in the
' window.
Picture2.AutoRedraw = True
' Make sure Picture1 is the same height as Picture2.
Picture1.Width = Picture2.Width
' The maximum scrolling rate will be 20 pixels at a time.