|
-
Sep 18th, 2012, 12:17 PM
#1
Re: [VB6] - animated gif function errors:(
What you do is search from one 21F9 to the next 21F9 and assume that is your images data you want and in some cases it will work but in other cases it will not work. Meter.gif is a good example of one that does not work using your method. When I try to use your output files in a Gif Image Viewer they are all invalid gif files but they are OK for just loading them back into a Picturebox because the Picturebox does not care if the file is invalid or not as long as there is an image in it. The fact that you are outputting invalid gif files tells you that your code is not right. I don't know where you got that code but who ever made it didn't understand the gif format completely. In the case of the meter.gif what is happening is you are displaying the same image over and over again but using the Left and Top values of the other frames and that is what is causing the flickering like results.
Here are some of the things you are doing incorrectly:
1) You search for the 1st 21F9 and assume that is the end of the Global Color Table. Then you make that your Header Block but that will not always work (meter.gif is an example). DO NOT use the 1st 21F9 as the end of the Color Table, use the exact length of the table.
2) You only search for 21F9 code and assume that is the image data you need but image data can also appear in a 21FF block so you ignore the image in these blocks and now you have an invalid gif file. This is what happened when you tried to animate the meter.gif; you actually put an image in the Header Block and then attached another image to it from your actualFrame data thus make a 2-image file. When you load that file back into a Picturebox only the 1st image is placed in the Picturebox which is the same image for all of the frames.
3) You are using the Index to the color table as the actual background color and this is incorrect. The Index points to the actual background color in the color table. In most cases you wind up with black because the Index is 0 and 0 is black.
4) You use GetPixel API to get the transparent color (or background color) from the 0,0 of the image and this is incorrect. The transparent color is in the color table and it has an Index to it just like the background color.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Sep 18th, 2012, 12:26 PM
#2
Thread Starter
PowerPoster
Re: [VB6] - animated gif function errors:(
 Originally Posted by jmsrickland
What you do is search from one 21F9 to the next 21F9 and assume that is your images data you want and in some cases it will work but in other cases it will not work. Meter.gif is a good example of one that does not work using your method. When I try to use your output files in a Gif Image Viewer they are all invalid gif files but they are OK for just loading them back into a Picturebox because the Picturebox does not care if the file is invalid or not as long as there is an image in it. The fact that you are outputting invalid gif files tells you that your code is not right. I don't know where you got that code but who ever made it didn't understand the gif format completely. In the case of the meter.gif what is happening is you are displaying the same image over and over again but using the Left and Top values of the other frames and that is what is causing the flickering like results.
Here are some of the things you are doing incorrectly:
1) You search for the 1st 21F9 and assume that is the end of the Global Color Table. Then you make that your Header Block but that will not always work (meter.gif is an example). DO NOT use the 1st 21F9 as the end of the Color Table, use the exact length of the table.
2) You only search for 21F9 code and assume that is the image data you need but image data can also appear in a 21FF block so you ignore the image in these blocks and now you have an invalid gif file. This is what happened when you tried to animate the meter.gif; you actually put an image in the Header Block and then attached another image to it from your actualFrame data thus make a 2-image file. When you load that file back into a Picturebox only the 1st image is placed in the Picturebox which is the same image for all of the frames.
3) You are using the Index to the color table as the actual background color and this is incorrect. The Index points to the actual background color in the color table. In most cases you wind up with black because the Index is 0 and 0 is black.
4) You use GetPixel API to get the transparent color (or background color) from the 0,0 of the image and this is incorrect. The transparent color is in the color table and it has an Index to it just like the background color.
the size of table is expressed on Bytes?
(i can see the value, like you see on my code... but i don't know if it's in Bytes or other way)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|