1

I have a requirement where I have many images and need to create a slide show with various image transitions and I should be able to save it as a gif file along with image transitions.

I am able to create various transitions between the images in C# but not yet found out how to save it as a gif. There is a component NGif which allows to create a gif with multiple images. I tried to save the image at every trasition and then create a gif of all these images but it does not show the transtion effect but shows only the image to be shown next at different transition level with black backgroud.

Is there a way to create a gif with transition effects between the images?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
user976508
  • 167
  • 4
  • 16
  • How are you drawing the slideshow? You will need to save the in-between images too. – George Duckett Oct 03 '11 at 11:07
  • I am saving the in between images but they are with black background not with the previous images – user976508 Oct 03 '11 at 11:37
  • Show us the code. It sounds like when you display it, you're relying on drawing over the top of the previous image, however, when you save the image that previous image isn't there (and you get black instead). – George Duckett Oct 03 '11 at 11:53
  • It would be difficult to post code here. Can I send it to your email address. – user976508 Oct 04 '11 at 04:20

2 Answers2

0

I would aim for a library that creates animated GIF. It either has to be .NET or COM based to easily use. Perhaps something like this project at CodeProject.

Gregory A Beamer
  • 16,870
  • 3
  • 25
  • 32
0

GIF doesn't support transparency with an alpha channel. The only transparency supported is full transparency (not an opacity level like with an alpha channel). You need to designate a palette entry as the transparent color, and then use that palette entry where you want transparency (GIF is always saved with a palette).

In animated GIF, the next image is overlaid on the previous one, so transparent areas show the previous image.

Alternatively, you could just render the entire new image and not rely on transparency.

Lou Franco
  • 87,846
  • 14
  • 132
  • 192