© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago•
4 replies
Shinobu [5th Koan]

Is there an issue with C# Winforms image resizing function?

I was using this snippet of code to resize the image and display to a picture box:
Bitmap resizedImage = new Bitmap(newWidth, newHeight, PixelFormat.Format32bppArgb);
using (Graphics g = Graphics.FromImage(resizedImage))
{
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.SmoothingMode = SmoothingMode.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.CompositingQuality = CompositingQuality.HighQuality;
g.DrawImage(currentImageOriginalSize, 0, 0, newWidth, newHeight);
}

currentImage = resizedImage;

and the image I got was more blurry than the one displayed online using HTML (we pulled from the same image source and the web doesn't use an external library. The picture box and the picture element has the same size). Is this a known issue or did I do something wrong?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

winforms clr/c++ usercontrol issue
C#CC# / help
3y ago
C# Image Resizing on Visual Studio Code
C#CC# / help
3y ago
c# winforms size
C#CC# / help
9mo ago
C# WinForms Chat
C#CC# / help
2y ago