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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -