c# - JpegBitmapEncoder QualityLevel has no effect -
i want save image jpeg jpegbitmapencoder setting qualitylevel has no effect? resulting jpeg same size (~4mb 2200x1500px).
rendertargetbitmap rtb = new rendertargetbitmap(collage.breite, collage.hoehe, dpi, dpi, system.windows.media.pixelformats.default); canvas.updatelayout(); rtb.render(canvas); jpegbitmapencoder jpgencoder = new jpegbitmapencoder(); jpgencoder.qualitylevel = 35; // no effect, image big jpgencoder.frames.add(bitmapframe.create(rtb)); using (var fs = system.io.file.openwrite(myfilename, variables))) { jpgencoder.save(fs); fs.close(); fs.dispose(); }
i changed to:
var fs = new filestream(myfilename, variables), filemode.create); jpgencoder.save(fs); fs.close();
Comments
Post a Comment