VB6, Resource, GIF

VB6, Resource, GIF

Post by Sylvai » Fri, 16 Apr 1999 04:00:00



I repost it here because it may be more appropriate in that NG... Thanks in
advance.

In order to show an interactive map on a form, I checked the Image control
can display GIF files.

But the "countries" of this map has to be in the ressource file. I checked
Q194409, it says the way to put a GIF in an Image control is to load it as
binary data then save it to the disk (temp file) then load it in the Image
from the file with LoadResPicture.

That is OK for a few Images, but I've to do it with a hundred of them, and
do at each move of the users mouse on the "country" ...

Does someone know a good "in memory" solution to load from res to Image a
GIF resource ?
Thank you.

Sylvain

 
 
 

VB6, Resource, GIF

Post by Sylvai » Tue, 20 Apr 1999 04:00:00


Gee, it seems to be a tough one ...
Thanks anyway.
Sylvain

 
 
 

VB6, Resource, GIF

Post by Johnn » Wed, 21 Apr 1999 04:00:00


I had a similar app that required a number of images to be displayed.I did
not use gifs
but the teqhnique I used may help you. I took 5 images at a time and and
turned them
into strips of 5 using "Paint Shop Pro" or whatever.

I then loaded these strips (6) in all into an array of hidden image
controls. I used Bitblt to load
a main Picturebox from the array as required.

You could also make the image strips smaller than the final image and use
the
Stretch property of the Image Control or Use StretchBlt with a PictureBox.

I actually made a resource file containing all of my images, but found no
real advantage
in distribution size.

I know this isn't exactly what you want but, the images are built into the
app, and cannot
be lost or tampered with by the user.

Of course you could always use a Database of images (yuk!)

Good Luck

 
 
 

VB6, Resource, GIF

Post by Sylvai » Thu, 22 Apr 1999 04:00:00


Thanks Johnny, I'll have a try at your solution.

The point is I have to change the images at run-time : it's why I have to
put them in the resource (or make an arry of hidden images ... or a
database - yuk too -).

Finally I did it building an UserControl, using 2 BMP images : one for the
color, one for the mask (I wanted image to be transparent). So it's
transparent. I added some properties, like Picture and PictureMask, then
load them with pictures (BMP) from RES and it works. The only thing is to
make a mask for every image... with PSP it's easy anyway.

Thanks again.
Sylvain

 
 
 

VB6, Resource, GIF

Post by Johnn » Thu, 22 Apr 1999 04:00:00


That seem's like a smart solution, I suppose this kind of task can be
approached from
several angles, including the picClip control or PaintPicture.

I think at the end of the day, it's the weight of the images in distribution
is the real problem.

On and off I work on an algorithm to unzip a zip of big images use them at
runtime and zip em up
when done.

All the best

 
 
 

1. CreateMappedBitmap with VB6 resource bitmap?

The first param takes a module instance, such as you would get from a
LoadLibrary call or from App.hInstance. Note that the latter will not work
in the IDE but should work in the compiled app.

Michael


2. SceneGraph->Rayshade format

3. How play an animated gif file in VB6

4. Printing bitmaps

5. Animated Gif in VB6.0

6. Alpha Blending

7. GIF as Resource to GIF as File

8. GIF Animation Resources (130+ programs listed)

9. gif animation - Web Resource

10. GIF Animation Resources (130+ programs listed]

11. UPDATED: GIF Animation Resources (130+ programs listed)