Convert bmp image format to jpg, gif, png format images : JPG « 2D Graphics « C# / C Sharp






Convert bmp image format to jpg, gif, png format images

  
class Program
{
    static void Main(string[] args)
    {
        // Load the image.
        System.Drawing.Image image1 = System.Drawing.Image.FromFile(@"C:\test.bmp");

        // Save the image in JPEG format.
        image1.Save(@"C:\test.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

        // Save the image in GIF format.
        image1.Save(@"C:\test.gif", System.Drawing.Imaging.ImageFormat.Gif);

        // Save the image in PNG format.
        image1.Save(@"C:\test.png", System.Drawing.Imaging.ImageFormat.Png);        
    }
}

   
    
  








Related examples in the same category

1.Load JPG file and paint the imageLoad JPG file and paint the image
2.Write Alpha Jpg