By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,828 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,828 IT Pros & Developers. It's quick & easy.

animations on visual basic

mrnn
P: 29
hello i'm tryin to figure out how to make an animation w/o the timer loading up a separate pic every .1 of a second or watever...is there a way how to upload one image with multiple pics on it and have it only show certain parts of the pic? (like a pic that's 128X32, show the first 32X32 square, then the second starting at 64, 96, 128 then 0 again) or some other way that's less taxing on the speed?

i used to do it by loading a new pic every so often or having separate, invisible pics it'd take the pics from but that taxed the speed too much with 5 different animated pics at once...oh and i dont know anythin about animated GIF's :P
Sep 16 '07 #1
Share this Question
Share on Google+
14 Replies


VBPhilly
P: 95
hello i'm tryin to figure out how to make an animation w/o the timer loading up a separate pic every .1 of a second or watever...is there a way how to upload one image with multiple pics on it and have it only show certain parts of the pic? (like a pic that's 128X32, show the first 32X32 square, then the second starting at 64, 96, 128 then 0 again) or some other way that's less taxing on the speed?

i used to do it by loading a new pic every so often or having separate, invisible pics it'd take the pics from but that taxed the speed too much with 5 different animated pics at once...oh and i dont know anythin about animated GIF's :P
have you tried messing with the forms redraw method?

Expand|Select|Wrap|Line Numbers
  1. form1.redraw = false
  2. 'do your processing: swapping pics, for example. 
  3. form1.redraw = true. 
  4.  
Sep 16 '07 #2

Expert 5K+
P: 8,434
...is there a way how to upload one image with multiple pics on it and have it only show certain parts of the pic? (like a pic that's 128X32, show the first 32X32 square, then the second starting at 64, 96, 128 then 0 again) or some other way that's less taxing on the speed?
It sounds as though you're describing the ImageList control. :)

You might also want to look into the Animation control, which plays AVI files and possibly (I'm not sure) animated GIF files. (I know you said you didn't know about them, but any decent graphics program these days should be able to create them from your series of images.)
Sep 17 '07 #3

mrnn
P: 29
It sounds as though you're describing the ImageList control. :)
I've heard of the ImageList control but i can't find it and dunno how it works X( ...i've tried finding something on it in the components list to add to the toolbar but i cant find it....and i've never heard of form redraw what is that about? as long as it doesnt take up too much processor speed my computer's too slow... (i've only been using visual basic 6 for 2 years, took a 1year class on it...just so u know:P)

oh and thanks for the help people :)
Sep 17 '07 #4

Expert 5K+
P: 8,434
I've heard of the ImageList control but i can't find it and dunno how it works X( ...i've tried finding something on it in the components list to add to the toolbar but i cant find it....and i've never heard of form redraw what is that about? as long as it doesnt take up too much processor speed my computer's too slow...
The Imagelist control is in the "Microsoft Windows Common Controls" library. I don't actually know much about it, but it is used to store a bunch of images for use in other controls.

I forget what else has been said here (in a real rush right now) but one option for animating is to simply have a bunch of Image controls in the same place, and either change their visibility one by one, or move each in turn to the front using the .ZOrder method.
Sep 18 '07 #5

mrnn
P: 29
The Imagelist control is in the "Microsoft Windows Common Controls" library.
I've tried to find that but couldn't...is it in the "components" menu on the toolbar? Or what? Sorry I'm not the best at how VB works...
Sep 18 '07 #6

Expert 5K+
P: 8,434
I've tried to find that but couldn't...is it in the "components" menu on the toolbar? Or what? Sorry I'm not the best at how VB works...
If you're using VB6, then you pull down the "Project" menu and select "Components". Or just press the shortcut key, Ctrl-T.

If you're using a later version of VB, I have no idea of how you add components.
Sep 18 '07 #7

mrnn
P: 29
oh found it...duh it was there all along i just forgot the word "windows" in there so i couldnt find it....sorry for being an airhead, i'll try my best not to ask another dumb question like that in the future

and thanks i really do appreciate the help :)
Sep 19 '07 #8

Expert 5K+
P: 8,434
No problem, glad to help. :)
Sep 19 '07 #9

mrnn
P: 29
Ok sorry if I sound dumb here but...how do I get this imagelist control to work? As in, how do I load the pics from the imagelist? I got my pics in it I need but now I need to figure out how to use them

If this helps any the player you control is imgPlayer and the imagelist is PlayerList, index1 pic is standing still and index2-7 is running.
Sep 22 '07 #10

QVeen72
Expert 100+
P: 1,445
Hi,

After loading the Images to the ImageList, Place a Timer Control on the Form, and make Interval = 1000 ( 1 second). Also Place a PictureBox or Image Control. Keep a FormLevel Variable say ImgIndex as Integer
In Timer1_Timer Event, u can Load the Image from ImageList, Increment the Variable and Load next Image. When it Reaches 7, make it 0

REgards
Veena
Sep 22 '07 #11

mrnn
P: 29
After loading the Images to the ImageList, Place a Timer ...
Not to sound rude but I already know that part, I just don't know how to load the images from the imagelist and put them in the image control.
Sep 22 '07 #12

Expert 5K+
P: 8,434
Not to sound rude but I already know that part, I just don't know how to load the images from the imagelist and put them in the image control.
Oh, how rude... 8-)

Seriously, though I haven't actually used it myself, from the doco I gather you would use something like...
Expand|Select|Wrap|Line Numbers
  1. Set imgPlayer.Picture = PlayerList.ListImages(1).Picture
I think I remember reading that you have to use Set in this case. Have a play with it, and also I suggest you look up the ImageList control in the doco. Just select imgPlayer on your form in design mode, and hit F1 - this should get you there.
Sep 22 '07 #13

mrnn
P: 29
Oh, how rude... 8-)

Seriously, though I haven't actually used it myself, from the doco I gather you would use something like...
Expand|Select|Wrap|Line Numbers
  1. Set imgPlayer.Picture = PlayerList.ListImages(1).Picture
I think I remember reading that you have to use Set in this case. Have a play with it, and also I suggest you look up the ImageList control in the doco. Just select imgPlayer on your form in design mode, and hit F1 - this should get you there.
SWEET! thanks for the help man, really appreciate it :)
Sep 23 '07 #14

Expert 5K+
P: 8,434
SWEET! thanks for the help man, really appreciate it :)
Glad to help. :)
Sep 23 '07 #15

Post your reply

Sign in to post your reply or Sign up for a free account.