hi,
how to resize an image to low size means i have images with size 140kb and 120kb and 90kb
i want to resize these images to bellow 50kb
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Master BillaRank #2,229 · 630 reputationPosted Sep 18, 2009, 6:35 AM EDT
Here code
{
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;
}
Thank you
Roei BarRank #1,271 · 1.4K reputationPosted Sep 18, 2009, 3:44 AM EDT
http://www.codeproject.com/KB/graphics/quick_snip.aspx
Pramod Kumar NandagiriRank #6,963 · 252 reputationPosted Sep 18, 2009, 10:13 PM EDT
is there any way to decrease the size of a jpeg image with out much effecting the height and width of that image
i want 250kb image compressed to 40kb with out effecting the height and width of the image
*******************************************************************************
another reqirement is: do u know about desktop resizing using c#.net then help me in this also
with my c#program i want to resize my pc desktop(it's not screen resolution , it's a monitor resolution)