Guest User

Untitled

a guest
Apr 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. Bitmap bm = (Bitmap)Image.FromFile(FilePath);
  2. ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
  3. ImageCodecInfo ici = null;
  4. foreach (ImageCodecInfo codec in codecs)
  5. {
  6. if (codec.MimeType == "image/jpeg")
  7. ici = codec;
  8. }
  9.  
  10. EncoderParameters ep = new EncoderParameters();
  11. ep.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, (long)100);
  12. bm.Save("C:\quality" + x.ToString() + ".jpg", ici, ep);
Add Comment
Please, Sign In to add comment