Click to See Complete Forum and Search --> : how to save imagelist contents


spidey
December 30th, 1999, 08:52 PM
Using VB 5.0 Pro
i remember there is a way to save the contents (the graphics) of an imagelist, but i dont remember how.

the only thing i remember is that it involved opening a file in binary mode, writing the variable or image collection (images) for later retrieval and use.

can somebody tell me how this is done?
(without thirdparty controls)
or any other way to do a image library (bmps and wmfs, etc) even an easy way to store them in a .mdb for later use (but i prefer the binary file =) )???



Yo soy el que hace que llegue a ser

Mikesc
January 2nd, 2000, 10:14 AM
You can down load the source code for an imageList control from www.vbaccelerator.com . You will find a routine for saving a imagelist to a file. If you want to try to figure it out on your own you'll need msdn documentation. It's really really hard but... you can use the GetDIBits API (I think that's the name of it) to scan the pixels of a picture into a byte array. The difficult part is each row of the picture has to be long aligned and how big your byte array is will have to take this into account as well as the color resolution of the picture. The greater the resolution the bigger your array. If you miscalculate and make the array to short the API will write over the byte array into the surrounding memory space and you'll crash and burn. The other difficult part is the pallete stuff. The vbacclerator code just switches everything to 32 bit resolution to do away with the palette problem. Like I said it's really a big headache. It took me at least two weeks to work everything out to get my imagelist to run properly and even then I relied heavily on the vbaccelerator code. good luck

spidey
January 3rd, 2000, 04:41 PM
from :
http://www.vb2themax.com/Item.asp?PageID=CodeBank&ID=35

just hoping there is something similar that works in vb5.o pro (this is for vb6 but is very close to what i saw before).

stiil hoping!



Yo soy el que hace que llegue a ser