Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 103017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:03:26+00:00 2026-05-11T01:03:26+00:00

Im trying to save a bitmap jpg format with a specified encoding quality. However

  • 0

Im trying to save a bitmap jpg format with a specified encoding quality. However im getting an exception (‘Parameter is not valid.’) when calling the save method.

If i leave out the two last parameters in the bmp.save it works fine.

        EncoderParameters eps = new EncoderParameters(1);         eps.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 16);         ImageCodecInfo ici = GetEncoderInfo('image/jpeg');         string outfile = outputpath + '\\' + fileaddition + sourcefile.Name;         bmp.Save(outfile,ici,eps );          bmp.Dispose();         image.Dispose();         return true;     }     ImageCodecInfo GetEncoderInfo(string mimeType)     {         int j;         ImageCodecInfo[] encoders;         encoders = ImageCodecInfo.GetImageEncoders();         for (j = 0; j < encoders.Length; ++j)         {             if (encoders[j].MimeType == mimeType)                 return encoders[j];         }         return null;     } } 

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:03:26+00:00Added an answer on May 11, 2026 at 1:03 am

    GDI+ is pretty flaky. You’ll need to use 16L for the value or cast to (long).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Bitmap that I'm trying to save and I keep getting the
I'm trying to save a bitmap to the sd card and by using the
Hello I am trying to save a bitmap image in a basic image editor
I am trying save an ImageButton's path in savedInstanceState in order not lose image
I am currently trying to save a bitmap image, but the background is changing
In ASP.NET C# I'm trying to save a bitmap image as an 16-color non-transparent
I am trying to download an 1mb image file and then save to bitmap
In this code I'm trying to: get a bitmap from an ImageView save it
I am trying to save image in sd card like as : Bitmap bitmap=Bitmap.createBitmap(400,
I'm banging my head over trying to save a jpg file using the samplegrabber

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.