Click here to Skip to main content
15,896,111 members
Articles / Programming Languages / C#

How to convert BMP to GIF in C#

Rate me:
Please Sign up or sign in to vote.
4.84/5 (11 votes)
2 Dec 2010CPOL 9.8K   5  
Very nice work. I would add a bit of reformatting and place it in all in method:public static void BitmapToGIF(string BitmapFile, string GIFFile){ using (Bitmap bitMap = new Bitmap(BitmapFile)) { //var codecInfo = GetEncoderInfo(ImageFormat.Gif); var...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
1 Dec 2010Andrew Rissing
I'd recommend a minor tweak to your code to remove the 'magic' string of the mimeType from the code, using the following:static void Main(string[] args){ Bitmap bitMap = new Bitmap(@"test.bmp"); var codecInfo = GetEncoderInfo(ImageFormat.Gif); var paramsEncoder = new...
Please Sign up or sign in to vote.
19 Dec 2010Kanasz Robert 3 alternatives  
How to convert BMP to GIF in C#
Please Sign up or sign in to vote.
21 Dec 2010johannesnestler
I think your solution is good if I have to control quality, compressionetc.For a fast conversion I do just this.Bitmap bmp = new Bitmap(@"C:\Example.bmp");bmp.Save(@"C:\Example.gif", ImageFormat.Gif);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO Marois Consulting
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions