By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,276 Members | 1,494 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,276 IT Pros & Developers. It's quick & easy.

Convert Tiff Images to Gif/Jpeg

P: n/a
Hello friends,

Can any body tell me the sample code to convert a Tiff image to a Gif
or Jpeg format. The Resolution of picture is a big concern keeping in
mind.
Hope to get the response from all of you.

Regards,
Pushp
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);

Saving to GIF is a variation on the theme.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Pushp" <pu*********@gmail.com> wrote in message
news:46**************************@posting.google.c om...
Hello friends,

Can any body tell me the sample code to convert a Tiff image to a Gif
or Jpeg format. The Resolution of picture is a big concern keeping in
mind.
Hope to get the response from all of you.

Regards,
Pushp

Nov 17 '05 #2

P: n/a
Hi !

Bob Powell wrote:
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");
Shouldn't that read

Bitmap bm = new Bitmap("mypic.tiff");

?

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);


But keep in mind that TIFF-files may contain more than one image. Have a
look at Bitmap.SaveAdd.
Nov 17 '05 #3

P: n/a
Actually, FromFile works because its in the base class of Bitmap so either
one will do.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Michael Voss" <mi********************@lvrREMOVE.CAPSde> wrote in message
news:42525768$1@news...
Hi !

Bob Powell wrote:
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");


Shouldn't that read

Bitmap bm = new Bitmap("mypic.tiff");

?

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);


But keep in mind that TIFF-files may contain more than one image. Have a
look at Bitmap.SaveAdd.

Nov 17 '05 #4

P: n/a
Yes. you're correct...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Michael Voss" <mi********************@lvrREMOVE.CAPSde> wrote in message
news:42525768$1@news...
Hi !

Bob Powell wrote:
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");


Shouldn't that read

Bitmap bm = new Bitmap("mypic.tiff");

?

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);


But keep in mind that TIFF-files may contain more than one image. Have a
look at Bitmap.SaveAdd.

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.