NHSE/NHSE.WinForms/Util/InterpolatingPictureBox.cs
2026-01-17 22:12:37 -06:00

21 lines
606 B
C#

using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace NHSE.WinForms;
public sealed class InterpolatingPictureBox : PictureBox
{
private readonly InterpolationMode InterpolationMode = InterpolationMode.HighQualityBicubic;
protected override void OnPaint(PaintEventArgs eventArgs)
{
eventArgs.Graphics.InterpolationMode = InterpolationMode;
base.OnPaint(eventArgs);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
pevent.Graphics.InterpolationMode = InterpolationMode;
base.OnPaintBackground(pevent);
}
}