When you resize the image you'll create an in-memory image and get a
graphics object for it somenthing like this...
Bitmap bm=new Bitmap(newsize. Width, newsize.Height) ;
Graphics g=Graphics.From Image(bm);
At this point you can set the interpolation mode...
g.Interpolation Mode=Interpolat ionMode.HighQua lityBilinear;
When you draw your image to the new bitmap, the interpolation mode will be
used...
g.DrawImage(old Image,new
Rectangle(0,0,o ldImage.Width,o ldImage.Height) ,0,0,bm.Width,
bm.Height,Graph icsUnit.Pixel);
g.Dispose();
Now save the image...
oldImage.Dispos e();
bm.Save(filenam e,ImageFormat.b mp);
--
Bob Powell [MVP]
C#, System.Drawing
The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
Read my Blog at
http://bobpowelldotnet.blogspot.com
"Eric Johannsen" <no*********@jo hannsen.us> wrote in message
news:d%******** *******@newssvr 14.news.prodigy .com...
Bob,
Can you point to any example code that does image resizing using the
bilinear interpolation modes? Is the interpolation provided by the
graphic driver or is it core system functionality?
Thanks,
Eric
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:#r******** ******@TK2MSFTN GP10.phx.gbl... When resizing the best you can do is use the HighQualityBili near or
HighQualityBicu bic interpolation modes. Making an image smaller will
inevitably result in averaging of the pixels which can make the image
appear blurred, When enlarging the image, you may see blurring due to
magnification and interpolation.
Not using the high quality interpolation modes will result in aliasing
which is much worse than blurring.
--
Bob Powell [MVP]
C#, System.Drawing
The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
Read my Blog at http://bobpowelldotnet.blogspot.com
"Zahid Khan" <zk***@ivey.com > wrote in message
news:00******** *************** *****@phx.gbl.. . I need little help in my situation.
I am reading a graphic file (jpg) from disk and then
resizing it and save resized image. What happens, it gets
blured, I want to retain same quality so that small image
won't be blur?
any tips or idea or technique?
Thanks in Advance.