02-06-2005, 08:11 PM
I am having a problem with images. I am using a gif image with no background, and it moves a certain amount to the left on a timer.The problem is the image's backgound falshes red whenever it moves. I cant figure out how to fix it, does anyone have any suggestions?
02-06-2005, 10:08 PM
Would this be an animated GIF? If I am not mistaken, VB 6.0 doesn't take a liking to animated GIF's and this may be where the problem lies. Try a search on animated GIF's and see if there is any help in that.
02-07-2005, 01:35 PM
No, its just a single frame gif, so thats not what the problem is.
02-07-2005, 02:45 PM
Are you using an Image control?
Image controls are great for static images, paticularly .gif files with a transparent background, but as soon as you start moving them around they flicker badly.
02-07-2005, 05:27 PM
Yes, I am using an image control with a transparent background. Soo, is there any way to display a moving gif with a transparent background, or do I just have to get really creative?
02-07-2005, 09:24 PM
Depending on what you are trying to do, you could just paint the picture onto the form (me.PaintPicture or the BitBlt API), but that mightnt be the best answer depending on what you are trying to do
02-07-2005, 11:46 PM
You just need to use PaintPicture or Bitblt with the appropriate ROP codes.
This Code Library thread has a link (in the last post) to a Beebe tutorial showing how to do transparent (static) backgrounds as well as a link to upgraded example that shows flickerfree movement with a transparent background:
Note: The secret to flickerfree transparent background images (sprites) in Visual Basic is generally through the use of masks.
Masks can be created at design time or at run time (programmatic).
The first post in the above thread creates a link to a program for doing design time masks (the relatively easier way).
A programmatic masking example (a bit more involved) can be found attached to this post: