|
|
Title | Use Image and ImageList controls to animate a series of images |
Description | This example shows how to use Image and ImageList controls to animate a series of images in Visual Basic 6. |
Keywords | Image, ImageList, animate |
Categories | Graphics, Controls |
|
|
The images are stored in an ImageList control. When the program starts, it saves the number of images.
When the Timer fires, the program displays the next image in the Image control.
|
|
Private m_Index As Integer
Private m_NumImages As Integer
Private Sub Form_Load()
m_NumImages = ImageList1.ListImages.Count
m_Index = 0
End Sub
Private Sub Timer1_Timer()
' Image indexes are between 1 and m_NumImages.
m_Index = ((m_Index + 1) Mod m_NumImages) + 1
Image1.Picture = ImageList1.ListImages(m_Index).Picture
End Sub
|
|
|
|
|
|