home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "ScrollBG"
- Enum DirX
- downx
- upx
- rightx
- leftx
- End Enum
- 'Scrolls Pictures using only 1 Pic Box (Timers work great with this)
- Public Sub BGScroll(pic As Object, Optional Direction As DirX)
- Static A As Integer, B As Integer
- pic.AutoRedraw = True
- pic.Picture = pic.Image
- Select Case Direction
- Case downx
- pic.PaintPicture pic.Picture, A, B + 1
- pic.PaintPicture pic.Picture, 0, 0, , , , pic.ScaleHeight - 1
- Case upx
- pic.PaintPicture pic.Picture, A, B - 1
- pic.PaintPicture pic.Picture, 0, pic.ScaleHeight - 1
- Case rightx
- pic.PaintPicture pic.Picture, A + 1, B
- pic.PaintPicture pic.Picture, 0, 0, , , pic.ScaleWidth - 1
- Case leftx
- pic.PaintPicture pic.Picture, A - 1, B
- pic.PaintPicture pic.Picture, pic.ScaleWidth - 1, 0
- End Select
- End Sub
-