[Mono-list] Unable to set JPEG Quality to 100% in Mono
thewall37 at gmail.com
Thu May 21 15:35:23 EDT 2009
I need to save my bitmap to jpeg with 100% quality (lowest compression). I
use this code:
Bitmap bmp = new Bitmap(w,h);
BitmapData bmpdata = bmp.LockBits(new Rectangle, 0, 0, w, h),
//Filling image with data - works for sure
ImageCodecInfo codecs = ImageCodecInfo.GetImageEncoders();
foreach(ImageCodecInfo codec in codecs)
if(codec.MimeType == "image/jpeg")
myCodec = codec;
if(myCodec == null)
throw new Exception("no jpeg codec found?!");
EncoderParameters eps = new EncoderParameters(1);
eps.Param = new EncoderParameter( Encoder.Quality, 100L );
bmp.Save("myfile.jpg", myCodec, eps );
The problem is that whatever I set in EncodeParameter I always get same -
Does anyone know why? Is it bug of implemetation System.Drawing?
The code was testen in .NET and worked fine.
My configuration: openSUSE 11.1 with Mono 2.4
I would appreciate your help!
View this message in context: http://www.nabble.com/Unable-to-set-JPEG-Quality-to-100--in-Mono-tp23657867p23657867.html
Sent from the Mono - General mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-list