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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -