Home

SpeakComputers.com | Text-to-Speech Software

Natural sounding TTS voice support | Cepstral TTS voices | Text to MP3 | Natural Readers

Text to Speech Software Text to Speech Voices SpeakComputer Text to Speech Software

Converting images from one format to another in C#

With C# .Net, converting images from one format to another is quick and easy. You can convert image formats from and to of any of the formats listed below.

Name Format Description
Bmp Gets the bitmap image format (BMP).
Emf Gets the enhanced Windows metafile image format (EMF).
Exif Gets the Exchangeable Image File (Exif) format.
Gif Gets the Graphics Interchange Format (GIF) image format.
Icon Gets the Windows icon image format.
Jpeg Gets the Joint Photographic Experts Group (JPEG) image format.
Png Gets the W3C Portable Network Graphics (PNG) image format.
Tiff Gets the Tag Image File Format (TIFF) image format.
Wmf Gets the Windows metafile (WMF) image format.


Converting images from one format to another is really just 2 line of code. (minus error checking).

Image format example.

In the following example, we are going to convert an existing image (png format) to gif format.

Bitmap bmp = new Bitmap("c:\\tmpImage.png");
//existing image.
bmp.Save("c:\\tmpImage.gif", System.Drawing.Imaging.ImageFormat.Gif);
//Saves the converted image to a file in the chosen image format.

Batch image conversion example.
In the following example, we will convert all png images in a directory to tiff images.

DirectoryInfo di = new DirectoryInfo(@"C:\images\png");
foreach (FileInfo file in di.GetFiles())
{
string imagename = Path.GetFileNameWithoutExtension(file.Name);
Bitmap bmp = new Bitmap(file.FullName);
bmp.Save(@"C:\images\tiff\\" + imagename + ".tiff", System.Drawing.Imaging.ImageFormat.Tiff, );
}

Top of page
Text to Speech Speech synthesis Software TTS Software
Copy Right 2006 SpeakComputers.com - All Rights Reserved.
About Privacy Policy TTS Resouces
Free Text to Speech software
Free Text to Speech Software