This is a discussion on How to convert jpg, bmp, tif,... image formats in to another format using c# .Net? within the C# Programming forums, part of the Software Development category; How to convert jpg, bmp, tif,... image formats in to another format using c# .Net? The very first step in ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| How to convert jpg, bmp, tif,... image formats in to another format using c# .Net? The very first step in working with images is to create an object of the Image class object, which is present in the System.Drawing namespace. Since converting image file format requires the image to be present as a file, we shall create the Image object using the FromFile static method of the class, as shown below: Image imgInFile=Image.FromFile(strFileName); strFileName is the complete path to the image file. Now that we have an Image object ready, the second line of code that converts the image to a specified file format is this: imgInFile.Save(strOutFileName,ImageFormat.Bmp); The first parameter to the Save method is the complete path to the output filename, while the second parameter is an enumeration, defined in System.Drawing.Imaging, that lets you specify the format in which the file should be saved. The above code saves the image as a .BMP file, but there are 8 more image file formats in which the image can be saved. |
| Sponsored Links |
| |||
| Yes... You can save the image (can which ever type of image) with the ImageFormat. System.Drawing.Imaging.ImageFormat is used to do that.....
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extract IPTC Metadata from jpeg and tiff image formats | Balasubramanian.S | C# Programming | 26 | 11-13-2008 01:19 PM |
| Converting image from one format to another in C# | Sathish Kumar | C# Programming | 24 | 06-04-2008 02:06 AM |
| Convert image to other image format using CODEC in .NET 3.0 | Mramesh | C# Programming | 0 | 02-07-2008 03:33 AM |
| How can you convert them to another format? | devarajan.v | PHP Programming | 1 | 07-26-2007 10:33 AM |
| Better Image Format | Joe | Web Design Help | 12 | 03-06-2007 11:31 PM |