Showing posts with label image. Show all posts
Showing posts with label image. Show all posts

Monday, December 7, 2009

How to generate a transparent GIF image using C#

There is apparently no easy way to generate a transparent GIF image using the .NET framework. Microsoft provided a method in the Bitmap class called MakeTransparent() but it doesn’t work for GIFs, it only seems to work for PNGs.

To create a transparent GIF you need to recreate the color table of the image using Imaging APIs. Unfortunately, this can be pretty slow for an ASP.NET Web application, and it has a lot of overhead, so I needed an alternative.

Solution:

The alternative is to alter the color table directly using the GIF specification. To implement this, I needed to save the non-transparent GIF to a MemoryStream, and then go through the binary data, updating the color table with the new transparency bits.

Friday, October 17, 2008

Animated gif files for AJAX loader

When you develop AJAX-based website you probably want beautiful animated gif image(s) to show to the user an AJAX activity (when user have to wait while AJAX is getting some data from server). So I found very useful website "ajaxload.info" where you can generate different "AJAX-loading" animated gif images. There is many templates. You can change colors, size, opacity for gif's.

If you using "Opera" than you can install wiget named "Animated loading image generator!" and generate gif's not quit your favourite website "калькулятор автокредита"