PictureBox : Zooming without anti-aliasing

J

John

I have an app where I want to show an icon in a large PictureBox.
I've set the SizeMode to Zoom but the icon image is extremely fuzzy because
the scaling up also anti-aliases. Is there a way to turn the anti-aliasing
off so I get a nice blocky icon image?
 
G

Guest

There's nothing built-in to PictureBox to change the way scaling of images is
performed. You would have to create your own PictureBox-derived class and
override OnPaint(). You could try simply setting Graphics.InterpolationMode
to Low. e.g.
protected override void OnPaint(PaintEventArgs pe)
{
pe.Graphics.InterpolationMode =
System.Drawing.Drawing2D.InterpolationMode.Low;
base.OnPaint(pe);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top