BizHawk/BizHawk.MultiClient/PCEtools/PCEBGCanvas.cs

32 lines
843 B
C#
Raw Normal View History

2013-04-15 02:14:14 +00:00
using System.Drawing;
2012-03-12 05:26:48 +00:00
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace BizHawk.MultiClient
{
public partial class PCEBGCanvas : Control
{
public Bitmap bat;
2013-04-15 02:14:14 +00:00
private const int BAT_WIDTH = 1024;
private const int BAT_HEIGHT = 512;
2012-03-12 05:26:48 +00:00
public PCEBGCanvas()
{
bat = new Bitmap(BAT_WIDTH, BAT_HEIGHT, PixelFormat.Format32bppArgb);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
//SetStyle(ControlStyles.SupportsTransparentBackColor, true);
2013-04-15 02:14:14 +00:00
Size = new Size(BAT_WIDTH, BAT_HEIGHT);
2012-03-12 05:26:48 +00:00
//this.BackColor = Color.Transparent;
2013-04-15 02:14:14 +00:00
Paint += BGViewer_Paint;
2012-03-12 05:26:48 +00:00
}
private void BGViewer_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawImageUnscaled(bat, 0, 0);
}
}
}