Groups | Blog | Home
all groups > dotnet drawing api > march 2007 >

dotnet drawing api : Image quality: ImageFormat.Jpeg


nvx
3/28/2007 1:04:47 PM
Hi,
is there a way to set the output quality of a saved JPEG graphics? I
need to save some graphs (using Bitmap.Save()) into files and would
like to have more than one file format available. I know PNG is
probably the best format for a raster line graphics, but some people
prefer JPEG or BMP to PNG. I compared two outputs (PNG and JPEG) and
must say the quality of JPEG should be better. It seems like the
"quality value" is set to cca 75/100.

When I save something to a JPEG from, say, GIMP, there is a slider for
setting the quality of the resulting picture. Is there some similar
option for ImageFormat.Jpeg in .NET 2.0?

Thanks for any help...

With regards
nvx
Michael Phillips, Jr.
3/28/2007 5:53:31 PM
[quoted text, click to view]

Yes, just set the Encoder quality to the desired value. See the following:
http://msdn2.microsoft.com/en-us/library/system.drawing.imaging.encoder.quality.aspx

nvx
3/28/2007 10:23:48 PM
Hello Michael,
thank you very much for your reply. It works great... :)

Have a nice day...

With regards
nvx


Michael Phillips, Jr. napsal:
[quoted text, click to view]
Bob Powell [MVP]
3/29/2007 12:00:00 AM
Check out the GDI+ FAQ.

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

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.





[quoted text, click to view]
nvx
3/29/2007 1:21:01 AM
Hi Bob,
thanks for the suggestion. I'll surely check it out, because it might
save me from headache later... ;)

Have a nice day...

With regards
nvx


Bob Powell [MVP] napsal:
[quoted text, click to view]
AddThis Social Bookmark Button