Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: VB6 Animated Gif's and ImageList control

129 views
Skip to first unread message

Kathryn Thomas

unread,
Mar 27, 2003, 10:53:14 AM3/27/03
to
Thanks to Randy and others for a series of questions I have had recently.

I have one more...

I have a series of animated gif files that I would not like to call from
the hard drive; rather I would like to be able to put them in an ImageList
control and call then from there into another control on the form. This
would protect the integrity of the images after distrobution.

Can anyone site an example on how to read an image from an ImageList
control and dump it into another control to display it on the form?

Which control would I use to play the animated gif and what methos would I
use to get it from the ImageList??

TIA

Kathryn Thomas

unread,
Mar 28, 2003, 7:45:42 PM3/28/03
to
Kathryn Thomas <a...@a.com> wrote in
news:Xns934B6E4...@216.166.71.238:

Please Help!

Visual Basic Wizard

unread,
Mar 29, 2003, 10:55:05 AM3/29/03
to
VB does not directly support animated GIFs. what you must do is to save
each frame of the bitmap to a file, then load each frame into the ImageList
control. To extract the images in the image list control you would use the
ListImages collection, which is 1-based. You could set up a timer control
to display the frames.

A more efficient approach would be to use a resource file for the
bitmaps and use the LoadPicture function to get the frames. This will
require less memory and will make the program smaller. It also avoids some
of the problems you can run into with the ImageList control.

--

Dan Rushe
drus...@comcast.com
visualba...@hotmail.com
ICQ#: 119626702

Five-card stud, nothing wild.
And the sky's the limit.

--Jean-Luc Picard, Star Trek: The Next Generation series finale
"Kathryn Thomas" <a...@a.com> wrote in message
news:Xns934B6E4...@216.166.71.238...

Kathryn Thomas

unread,
Mar 29, 2003, 3:03:05 PM3/29/03
to
"Visual Basic Wizard" <drus...@comcast.net> wrote in
news:A2Odncboq8W...@comcast.com:

> VB does not directly support animated GIFs. what you must do is
> to save
> each frame of the bitmap to a file, then load each frame into the
> ImageList control. To extract the images in the image list control
> you would use the ListImages collection, which is 1-based. You could
> set up a timer control to display the frames.
>
> A more efficient approach would be to use a resource file for the
> bitmaps and use the LoadPicture function to get the frames. This will
> require less memory and will make the program smaller. It also avoids
> some of the problems you can run into with the ImageList control.
>
> --
>
> Dan Rushe
> drus...@comcast.com
> visualba...@hotmail.com
> ICQ#: 119626702
>
> Five-card stud, nothing wild.
> And the sky's the limit.
>


I guess I could do that, but I have 45 animated images @ 40 frames each,
though not all are shown and animated at the same time...

That's 1800 images that I would have to import into a resource file...

Not only that, but some of the animated gifs have a transparency...

Any other suggestions??

Visual Basic Wizard

unread,
Mar 29, 2003, 10:30:10 PM3/29/03
to
Using that many images with an ImageList will definitely cause problems.
One of the first games I wrote with VB6 I use an ImageList to store the
hoards of graphics used, which MS suggested to do in the MSDN. Well, the
@#$%^&! app absolutely refused to compile into an EXE because somewhere I
has hitting a 64K boundary. Every time I tried to compile it, the compiler
would barf, an all VB would throw up is an "Out of Memory" error. After
doing a hundred Google searches and combing through the MSDN for a week, I
gave up and put the pictures in the resource file. The app finally decided
to compile after that.

What I ended up doing, was as the app loads, I load the animations into
arrays of Picture objects. I then use timers to show the frames.

--

Dan Rushe
drus...@comcast.com
visualba...@hotmail.com
ICQ#: 119626702

Five-card stud, nothing wild.
And the sky's the limit.

--Jean-Luc Picard, Star Trek: The Next Generation series finale


"Kathryn Thomas" <a...@a.com> wrote in message

news:Xns934D989...@216.166.71.238...

0 new messages