1
0
mirror of synced 2024-12-03 11:37:21 +01:00
Switch-Toolbox/Switch_Toolbox_Library/GUI Custom/PictureBoxCustom.cs
2018-11-11 19:48:33 -05:00

35 lines
924 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace Switch_Toolbox.Library.Forms
{
public class PictureBoxCustom : PictureBox
{
public PictureBoxCustom()
{
this.BackgroundImage = GetCheckerBackground();
this.BackColor = Color.Transparent;
this.SizeMode = PictureBoxSizeMode.Zoom;
}
public Image GetCheckerBackground()
{
return Properties.Resources.CheckerBackground;
}
protected override void OnPaint(PaintEventArgs pe)
{
pe.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
pe.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
base.OnPaint(pe);
}
}
}