[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

prevent smoothing when stretching image

Norvin Laudon

11/27/2004 6:38:00 PM

Hi,

I'm painting images of various sizes into a picture box, and have the
"SizeMode" property set to "StretchImage". This looks OK when the image I am
painting is larger than the picturebox.
But when the image is smaller than the picture box, the image seems to have
some sort of filtering (bilinear?) going on resulting in a blurry picture. I
would prefer to see a nice pixellated unfiltered view of the image.

Can I set the filter type for this stretching operation? I've also tried
painting the image using Drawimage on the picturebox's graphics, but it
still seems to use some kind of filtering.

TIA,
Norvin


1 Answer

Bob Powell

11/27/2004 8:05:00 PM

0

Set the InterpoltionMode to something like NearestNeighbor

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Norvin Laudon" <123@asd.com> wrote in message
news:e$6BUAL1EHA.1188@tk2msftngp13.phx.gbl...
> Hi,
>
> I'm painting images of various sizes into a picture box, and have the
> "SizeMode" property set to "StretchImage". This looks OK when the image I
am
> painting is larger than the picturebox.
> But when the image is smaller than the picture box, the image seems to
have
> some sort of filtering (bilinear?) going on resulting in a blurry picture.
I
> would prefer to see a nice pixellated unfiltered view of the image.
>
> Can I set the filter type for this stretching operation? I've also tried
> painting the image using Drawimage on the picturebox's graphics, but it
> still seems to use some kind of filtering.
>
> TIA,
> Norvin
>
>