Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Animation in VB?

Status
Not open for further replies.

FractalWalk

Technical User
Nov 18, 2002
141
0
0
US
I want to create an animated sequence using frame animation (sequence of jpegs or bitmaps). There will probably be about 1000 frames, each about 300x400 pixels. Can this be done effectively in VB5? Will these images load into a from quickly enough to animate?

If not VB, what is a good way to go about this?
 
Why don't you create a gif animation with these many pictures and then put a control in your form to play it??


here is the dll you need:


In 2 days I'll remove it from the site.

Download it and use this syntax:
(Gif89.filename="c:\myGif.gif")

Ok ?
 
If you've got XP you could always look at Windows Movie Maker to create a WMV file from your jpegs and/or bitmaps; this can then be replayed through the media player control
 
I can't use gifs as I have too many colors too display. And unfortunately I do not have XP but that is the kind of functionality I need.

How can I do that with 98 or 2000?
 
bclt:

I'm a novice at VB so what does that driver allow me to do and how do I use it?
 
1. Download it

2. Goto: Project > references > click "Browse" to find the file, and click "ok"

3. Right click on the toolbar with the controls > Components > Goto to find in the list "gif89". Check it and click "ok"

4. Drag'n drop the control from the toolbar in you form and:

4a. fill in the property "filename" with e.g C:\myGif.gif

OR

4b. Do it programmatically... gif89.filename = "c:\myGif.gif
 
Just to follow up my own post:

I originally tried to make a PictureBox, add a timer and load new frames to animate the PictureBox. That did not work well at all as memory issues caused the loading to be way too slow for animation.

After a bunch of research, I tripped across a game developer's site that discussed DirectDraw and how it was created to solve the problems I was experiencing.

DirectDraw is a library for VB that uses video memory to load and draw images to "surfaces" way faster than loading them onto a form. The code is a little difficult to comprehend at first, but it is definitley the way to go for animations in VB.
 
We've illustrated using DirectDraw from VB6 in here on a number of occassions. Eg this: thread222-781574
 
We've illustrated using DirectDraw from VB6 in here on a number of occassions."

I didn't think I was posting anything new. It's just that no one mentioned DirectDraw in this thread before even though it seems like the obvious solution.

As I had never heard of it before I couldn't really search on it. So I posted a follow up so that other novices, who search on "animation", like I did, might find out about DirectDraw.
 
Er ... I was just providing a link, not criticising, you know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top