0

What is wrong in my code Original 197 Kb bitmap i wanna make less without lessing quality ( little can be ) but when use above code, size be more than original size like 247Kb WHY? - What's wrong

 //I added already Drawing.dll in Referance for using drawing class in WPF
//Bitmap size 197Kb without any encode
ImageCodecInfo ci = GetEncoer(ImageFormat.Png);
System.Drawing.Imaging.Encoder enc;
EncoderParameter ep;
EncoderParameters eps;

enc = System.Drawing.Imaging.Encoder.Quality;
ep = new EncoderParameter(enc,1L);
eps = new EncoderParameters(1);
eps.Param[0] = ep;
MemoryStream ms = new MemoryStream();
bitmap.Save(ms, ci, eps);
Image img = Image.FromStream(ms);
Bitmap bmp = new Bitmap(img);
return bmp;
//After aplly this function size 257Kb
Toprak
  • 283
  • 1
  • 4
  • 11
  • Edited your question tags and title. You're asking about `System.Drawing.Imaging` stuff, which is WinForms, not WPF. – Clemens Jul 17 '14 at 12:32
  • Yes but i am working with WPF and addeed Drawing.dll in referance already and i used already Imaging class so much time ... Code also work without any exeption but when i get new bitmap size not smaller than orginal actualy more than orginal i mean why? – Toprak Jul 17 '14 at 12:33

0 Answers0