469,943 Members | 2,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,943 developers. It's quick & easy.

Convert Tiff Images to Gif/Jpeg

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

Similar topics

reply views Thread by Paul | last post: by
3 posts views Thread by Kim Schulz | last post: by
5 posts views Thread by Sameer Gupta | last post: by
1 post views Thread by Scott Elgram | last post: by
1 post views Thread by a.mustaq | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.