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 3663418
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:31:40+00:00 2026-05-19T01:31:40+00:00

I using simple re-size method to change my bitmap to new size. The original

  • 0

I using simple re-size method to change my bitmap to new size.
The original bitmap size is 320×240 and i change the size two times

  • To 250×160
  • Doing some process on the bitmap
  • Change it back to 320×240

I found out that after i change it back to 320×240 i see that the bitmap is little smooth and not as i excepted.

How can i avoid this smooth to appear ?

The Resize method:

private static Image resizeImage(Image imgToResize, Size size)
{

   int sourceWidth = imgToResize.Width;
   int sourceHeight = imgToResize.Height;

   float nPercent = 0;
   float nPercentW = 0;
   float nPercentH = 0;

   nPercentW = ((float)size.Width / (float)sourceWidth);
   nPercentH = ((float)size.Height / (float)sourceHeight);

   if (nPercentH < nPercentW)
      nPercent = nPercentH;
   else
      nPercent = nPercentW;

   int destWidth = (int)(sourceWidth * nPercent);
   int destHeight = (int)(sourceHeight * nPercent);

   Bitmap b = new Bitmap(destWidth, destHeight);
   Graphics g = Graphics.FromImage((Image)b);
   g.InterpolationMode = InterpolationMode.HighQualityBicubic;

   g.DrawImage(imgToResize, 0, 0, destWidth, destHeight);
   g.Dispose();

   return (Image)b;
}
  • 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-19T01:31:41+00:00Added an answer on May 19, 2026 at 1:31 am

    Since you’re using the HighQualityBicubic interpolation mode, the image will be prefiltered and resized using the highest possible quality, resulting in the “smoothing effect”.

    You can try setting the InterpolationMode property to NearestNeighbor to obtain a “rougher” result:

    Bitmap b = new Bitmap(destWidth, destHeight);
    using (Graphics g = Graphics.FromImage((Image) b)) {
        g.InterpolationMode = InterpolationMode.NearestNeighbor;
        g.DrawImage(imgToResize, 0, 0, destWidth, destHeight);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following simple Go code to allocate a 3D array of size
I'm using simple-html-dom to try and pull some code from another site. Here's some
I'm writing a simple jQuery that to change the font size of an element
I am trying to obtain the same files using Intersect method from two folders.
I'm using the Simple XML library to process XML files in my Android application.
I'm writing some wxWidgets samples for educational purposes. My problem is simple: I'm using
Using simple type like class A { public int X, Y; } with object
Using simple field width specifier, the columns are 'thinner' when the string includes 'European'
im using simple vector push_back to object of Type A and getting this error
When using simple request to post to Twitter the messages are signed with sent

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.