dmiranda
07-12-2003, 02:14 PM
I just bought paint shop pro and created my first .avi file.
However, I have no idea how to impliment animations into a form.
I tried to use that MSDN library, but it really doesn't help.
I just need to see a simple program with start and stop buttons to make an image box run an animation. Thats all, just all the code (including variables, etc, if need be) necessary to do that.
I apologize if sounds too newb, but I really do appreciate any help with this.
Thanks
Bobo the Thief
07-12-2003, 03:49 PM
Just load the component "Windows Media Player" and put one instance on a form, then:
Option Explicit
Private Sub Form_Load()
MediaPlayer1.FileName = "d:\clips\evanescence - bring me to life.avi"
End Sub
If you don't want your app to be dependant on outside components, you could convert it to a .gif, then play the .gif in a picture box frame by frame. The file size will be smaller also.
'Rekd
dmiranda
07-13-2003, 11:38 AM
Thanks for the replies.
Is all I do just put the .gif into the picture property of an image?
I tried that and all it does is show the first frame of the animation, so I'm guessing thats not it.
The best way for me to learn programming is to be able to copy and paste all the code necessary to make it work. I tried to use
Just load the component "Windows Media Player" and put one instance on a form, then:
VB:
--------------------------------------------------------------------------------
Option Explicit
Private Sub Form_Load()
MediaPlayer1.FileName = "d:\clips\evanescence - bring me to life.avi"
End Sub
--------------------------------------------------------------------------------
Subsituting my .avi "C:\My Documents\Project Tank\FiredRight.avi" for "d:\clips\evanescence - bring me to life.avi".
So my code looked like this:
Option Explicit
Private Sub Form_Load()
MediaPlayer1.FileName = "C:\My Documents\Project Tank\FiredRight.avi"
End Sub
It errored out saying that an object was required for MediaPlayer1
Im assuming that I need to impliment a library of some sort into my code, however I do not know which one.
How do I tell the vb to play the .avi in a image box?
Please, just I need all the code (including libraries/variables, properties needed, etc.) to make a simple two button start/stop animation. Having the animation used in a image box.
I know I am novice, but this is the best way I learn.
Thanks for any help you can give.
To get the .gif to actually animate, you have to seperate the frames via code. I'm at work now, but have a snippit at home that will do it. I'll post it later tonite.
'Rekd
Bobo the Thief
07-13-2003, 02:45 PM
a)you don't put avis in Image or Picturebox controls.
b)you put gifs in either of them, but only the first frame gest shown.
c)for animated gifs you need a special control like AniGif - which is unauthorized and needs to be payd for.
d)if you are to give up on avi, choose Flash instead of Gif
e)the media player is still the easiest option - so make sure you have put the control on your form and that its name is "MediaPlayer1". As I said, you need to go to Project>Components>Insertable Objects and check "Windows Media Player" at the bottom of the list, then use the toolbar to create the object at design time.
NWolfer
12-29-2003, 03:36 PM
a)you don't put avis in Image or Picturebox controls.
b)you put gifs in either of them, but only the first frame gest shown.
c)for animated gifs you need a special control like AniGif - which is unauthorized and needs to be payd for.
d)if you are to give up on avi, choose Flash instead of Gif
e)the media player is still the easiest option - so make sure you have put the control on your form and that its name is "MediaPlayer1". As I said, you need to go to Project>Components>Insertable Objects and check "Windows Media Player" at the bottom of the list, then use the toolbar to create the object at design time.
Concerning ANIGIF, the window displayed just after RUN and which informed about registration look like obsolete. The URL does not work and I do not know what to do to fix this problem.
I would like to put an animed "gif" picture in my Frame. Do you know an other solution.
Thanks in advance,
Nicolas Wolfer