Hi Cath,
You are a very lucky guy (or girl)
The group had some fun and Armin got a challenge, he did contribute it about an hour ago, it is in this group. It even goes with a picture, you have to make it yourself with text.
I did copy it for you (and tested it) it is only a sample
\\\q&d needs a panel on a form
Private m_StartTicks As Integer = Environment.TickCount
Private m_Bmp As New Bitmap( _
"G:\enterthepathwherethebitmapcanbefound\Bitmap1.bmp" _
)
Private Sub Timer1_Tick( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Timer1.Tick
UpdatePanel()
End Sub
Private Sub UpdatePanel()
Dim Diff As Integer
Dim g As Graphics
Diff = Environment.TickCount - m_StartTicks
g = Me.Panel1.CreateGraphics
g.DrawImage( _
m_Bmp, 0, 0, _
New Rectangle( _
0, Diff \ 20, Me.Panel1.Width, Me.Panel1.Height _
), GraphicsUnit.Pixel _
)
g.Dispose
'TODO: watch exceeding the bitmap's height and
'implement a loop
End Sub
Private Sub Panel1_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles Panel1.Paint
UpdatePanel()
End Sub
and: timer1.interval=100
If you want it *really* smooth it occupies some more cpu power: (also q&d)
Shared Sub main()
'I never use "Call", but "(New Form1).ShowDialog"
'does not work
Call (New Form1).ShowDialog()
End Sub
Public Shadows Sub ShowDialog()
Dim rect As Rectangle
Dim StartTicks As Integer
Me.Show()
Me.Refresh()
rect.Width = Me.Panel1.Width
rect.Height = Me.Panel1.Height
StartTicks = Environment.TickCount
Do
Dim Diff, Y As Integer
Dim g As Graphics
Diff = Environment.TickCount - StartTicks
rect.Y = Diff \ 20
'TODO: same todo as above...
g = Panel1.CreateGraphics
g.DrawImage(m_Bmp, 0, 0, rect, GraphicsUnit.Pixel)
g.Dispose()
Application.DoEvents()
Loop While Me.Created
End Sub
I hope this helps a little bit?
(compliments to Armin)
Cor