Nov 4, 2017 08:37 PM
(This post was last modified: Nov 4, 2017 09:03 PM by JUSTIN.)
I've had this issue for a while.
When I tried to use icons/pictures on windows forms, they'd often have pretty pixelated edges.
Here's a neat way to fix it using a custom component which allows you to use the base PictureBox with some custom properties.
For best results:
Pictures (Click to View)
Concept taken from here, I basically just added the PixelOffsetMode and figured some people on here might find it useful.
When I tried to use icons/pictures on windows forms, they'd often have pretty pixelated edges.
Here's a neat way to fix it using a custom component which allows you to use the base PictureBox with some custom properties.
Code
public class CPictureBox : PictureBox
{
public InterpolationMode InterpolationMode { get; set; }
public PixelOffsetMode PixelOffsetMode { get; set; }
protected override void OnPaint(PaintEventArgs paintEventArgs)
{
paintEventArgs.Graphics.InterpolationMode = InterpolationMode;
paintEventArgs.Graphics.PixelOffsetMode = PixelOffsetMode;
base.OnPaint(paintEventArgs);
}
}Code
InterpolationMode: HighQualityBilinear
PixelOffsetMode: HighQualityPictures (Click to View)
Concept taken from here, I basically just added the PixelOffsetMode and figured some people on here might find it useful.


![[Image: rzl4e7e.png]](https://i.imgur.com/rzl4e7e.png)
![[Image: FURFRGv.png]](https://i.imgur.com/FURFRGv.png)

![[Image: Syr3DlV.png]](https://i.imgur.com/Syr3DlV.png)