Bitmap
|
public static Bitmap ConvertTo( this Image originalImage, ImageFormat newFormat )
using System; using System.Drawing; using System.Drawing.Imaging; using GSF.Drawing; class Program { static void Main(string[] args) { // Load the original image. Bitmap original = (Bitmap)Bitmap.FromFile("Original.jpg"); // Convert the original image. Bitmap originalGif = original.ConvertTo(ImageFormat.Gif); // Save the converted image to file. originalGif.Save("OriginalGif.gif"); // Clean-up. original.Dispose(); originalGif.Dispose(); Console.ReadLine(); } }