06-12-2001, 04:05 PM
Hey all, I'm a beginner in Visual Basic and I have been programming games for about a week or so now. I am trying to do some very basic animation and here's my problem: I have an image, lets just call it imgMain. I have a timer control with the interval property set to three thousand milliseconds. So how would it be possible to change the appearance of the picture (basically put in a different picture) every 9000 milliseconds? For example, if the imgMain image was a picture of a person, every 9000 milliseconds or so, I would like to make one of the legs stick out by changing and putting in a new image. Can anyone please tell me the source code for this?
06-12-2001, 04:24 PM
You can load a picture at runtime using the LoadPicture function:
picture1.picture = LoadPicture("c:\windows\rivet.bmp")
but a faster alternative is just to have 2 image boxes (or pictureboxs) preloaded with the desired pictures. You move them over each other (ie. in the same location), then make one invisible.
During run time. You make the visible one invisible and the invisible one visible.
You can expand on this method using control arrays or using the imagelist control as well...
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
06-13-2001, 10:46 AM
well here is the basic code to make a bird appear its flying
if birdopen.picture = birdopen.picture
then birdopen.picture = birdclose.picture
else birdclose.picture = birdopen
pckbmp = not pckbmp
hope this helps