IT Community - Software Programming, Web Development and Technical Support

How to convert jpg, bmp, tif,... image formats in to another format using c# .Net?

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-17-2007, 10:56 PM
Archer Archer is offline
D-Web Programmer
 
Join Date: Jun 2007
Posts: 52
Archer is on a distinguished road
Default How to convert jpg, bmp, tif,... image formats in to another format using c# .Net?

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-07-2007, 08:23 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: How to convert jpg, bmp, tif,... image formats in to another format using c# .Net

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!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 08:42 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0