animations on visual basic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrnn
    New Member
    • Sep 2007
    • 29

    animations on visual basic

    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
  • VBPhilly
    New Member
    • Aug 2007
    • 95

    #2
    Originally posted by mrnn
    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?

    Code:
    form1.redraw = false
    'do your processing: swapping pics, for example. 
    form1.redraw = true.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by mrnn
      ...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.)

      Comment

      • mrnn
        New Member
        • Sep 2007
        • 29

        #4
        Originally posted by Killer42
        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 :)

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by mrnn
          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.

          Comment

          • mrnn
            New Member
            • Sep 2007
            • 29

            #6
            Originally posted by Killer42
            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...
            Last edited by Killer42; Sep 18 '07, 10:58 PM. Reason: Fixed closing QUOTE tag

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Originally posted by mrnn
              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.

              Comment

              • mrnn
                New Member
                • Sep 2007
                • 29

                #8
                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 :)

                Comment

                • Killer42
                  Recognized Expert Expert
                  • Oct 2006
                  • 8429

                  #9
                  No problem, glad to help. :)

                  Comment

                  • mrnn
                    New Member
                    • Sep 2007
                    • 29

                    #10
                    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.

                    Comment

                    • QVeen72
                      Recognized Expert Top Contributor
                      • Oct 2006
                      • 1445

                      #11
                      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

                      Comment

                      • mrnn
                        New Member
                        • Sep 2007
                        • 29

                        #12
                        Originally posted by QVeen72
                        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.

                        Comment

                        • Killer42
                          Recognized Expert Expert
                          • Oct 2006
                          • 8429

                          #13
                          Originally posted by mrnn
                          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...[CODE=vb]Set imgPlayer.Pictu re = PlayerList.List Images(1).Pictu re[/CODE]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.

                          Comment

                          • mrnn
                            New Member
                            • Sep 2007
                            • 29

                            #14
                            Originally posted by Killer42
                            Oh, how rude... 8-)

                            Seriously, though I haven't actually used it myself, from the doco I gather you would use something like...[CODE=vb]Set imgPlayer.Pictu re = PlayerList.List Images(1).Pictu re[/CODE]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 :)

                            Comment

                            • Killer42
                              Recognized Expert Expert
                              • Oct 2006
                              • 8429

                              #15
                              Originally posted by mrnn
                              SWEET! thanks for the help man, really appreciate it :)
                              Glad to help. :)

                              Comment

                              Working...