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

  • Home
  • SEARCH
  • 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 3272316
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:48:48+00:00 2026-05-17T18:48:48+00:00

i use this code to create thumbnails System.Drawing.Image.GetThumbnailImageAbort abort = new System.Drawing.Image.GetThumbnailImageAbort(this.ThumbnailCallback); System.Drawing.Image image2

  • 0

i use this code to create thumbnails

System.Drawing.Image.GetThumbnailImageAbort abort = new System.Drawing.Image.GetThumbnailImageAbort(this.ThumbnailCallback);
System.Drawing.Image image2 = image.GetThumbnailImage((int)Math.Round((double)wid / difference), (int)Math.Round((double)hei / difference), abort, IntPtr.Zero);
image2.Save(str2, System.Drawing.Imaging.ImageFormat.Jpeg);
image2.Dispose();

but i get this very low quality image

alt text

but it is suposed to be like this one

alt text

what i am making wrong
or how can achieve this

  • 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. Editorial Team
    Editorial Team
    2026-05-17T18:48:49+00:00Added an answer on May 17, 2026 at 6:48 pm

    Your problem is not really with the GetThumbnailImage() method, but instead in how you are saving the file. You need to specify the quality level of the JPEG you are saving, or it seems it always defaults to a very low value.

    Consider this code as a guide (it’s from an old .NET 2.0 project; the code still works fine compiled against 4.0, but there may be a more direct method in 4.0; I’ve never had reason to check)

    ImageCodecInfo[] encoders = ImageCodecInfo.GetImageEncoders();
    ImageCodecInfo jpegEncoder = null;
    for (int x = 0; x < encoders.Length; x++) {
        if (string.Compare(encoders[x].MimeType, "image/jpeg", true) == 0) {
            jpegEncoder = encoders[x];
            break;
        }
    }
    if (jpegEncoder == null) throw new ApplicationException("Could not find JPEG encoder!");
    EncoderParameters prms = new EncoderParameters(1);
    prms.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 80L);
    bitmap.Save(fileName, jpegEncoder, prms);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this code to create an image from another png image, the background
I use this piece of code to make thumbnails of an uploaded image. $file
i'm starter in jqgrid, i write this code for create and fill jqgrid(i'm use
This is the code i use to create a graph which searches for .csv
I use this code to create and show a MessageWindow: var newTitleWindow:MessageWindow = PopUpManager.createPopUp(contextView,MessageWindow,
I use this code to create a simple jquery carousel animation: $(document).ready(function() { var
I use this code for create my custom annotation view. - (MKAnnotationView *)mapView:(MKMapView *)mV
I use this code for create a 80x30 mm pdf file with a 25x25
I use this code to create and run the timer, which works OK. NSDate
I've created this code, it is supposed to use wordpress metabox functionality to save

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.