You should use the one from post #2 testing disposed animated gif files.zip. It handles all of your gif images.
About the disposal values (methods)
Byte X1 is what you are concerned withCode:Each frame has the following: 21 F9 04 X1 X2 X3 X4 00 21 F9 these two bytes define the start of the Graphic Control Extension (GCE) 04 this byte tells you there are 4 bytes (to follow) of GCE data X1 this byte has the Disposal code and whether or not there is a transparent color X2 X3 delay for animation: not used X4 value defines which color from the color table is transparent 00 end of GCE block Following the previous byte is this one 2C called the Image Descriptor ' ' ' '
If the low order bit is 1 then there is a transparent color so use byte X4 to get that color from the color table.
The following calculation extracts the Disposal code from this byte
DisposalCode = (X1 \ 4) And 3
From above we get one of the following
0 Undefined
1 Leave
2 Restore Background
3 Restore Previous
OK, so much for that
Now, about avoiding temp files. It could be possible but would require a lot of rewriting the code. The code saves extracted frames from the original file. These saved pieces of data are actually made into a new gif file format so it can be reloaded back into an Image control using the LoadPicture method. To avoid this you would need to save the image data in memory using various APIs which only saves the image data and not the attributes you need, like the disposal values, transparent color, etc. You would also have to save the new gif file string in a string variable which corresponds to the image data also saved. Now you need to examine the string containing the file format to get the attributes you need and then load the image data into the Picture property of an Image control. However you would have to do the work yourself of making the transparent color which is done for you using the LoadPicture method. This requires additional efforts on your part which might be a little more complicated than you may want to get into.




Reply With Quote