本帖最后由 13573156105 于 2019-3-11 14:58 编辑
RasterCodecs codec = new RasterCodecs();
// Load the image
RasterImage image0 = codec.Load("D:\001.jpg");
// Creates a new image in memory with same dimensions as the source image
RasterImage destImage = new RasterImage(
RasterMemoryFlags.Conventional,// None Conventional
image0.Width + 10,
image0.Height +10,
image0.BitsPerPixel,//BytesPerLine BitsPerPixel
image0.Order,
image0.ViewPerspective,
image0.GetPalette(),
IntPtr.Zero,
0);
// 保存图像
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
codecs.Options.Jpeg.Save.QualityFactor = 25;// min 0 or 2 and max 255
codecs.Save(destImage , "D:\002.jpg", RasterImageFormat.Jpeg422, 0);
随便找个图片,处理完后,分辨率全部是150 |