BizHawk/BizHawk.Client.EmuHawk/tools/PCE/PCEBGCanvas.cs

30 lines
728 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.Client.EmuHawk
2012-03-12 05:26:48 +00:00
{
2013-11-20 01:37:54 +00:00
public class PCEBGCanvas : Control
2012-03-12 05:26:48 +00:00
{
2013-11-20 01:37:54 +00:00
public Bitmap Bat;
2012-03-12 05:26:48 +00:00
2013-04-15 02:14:14 +00:00
private const int BAT_WIDTH = 1024;
2013-11-20 01:37:54 +00:00
private const int BAT_HEIGHT = 512;
2013-04-15 02:14:14 +00:00
2012-03-12 05:26:48 +00:00
public PCEBGCanvas()
{
2013-11-20 01:37:54 +00:00
Bat = new Bitmap(BAT_WIDTH, BAT_HEIGHT, PixelFormat.Format32bppArgb);
2012-03-12 05:26:48 +00:00
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
2013-04-15 02:14:14 +00:00
Size = new Size(BAT_WIDTH, BAT_HEIGHT);
Paint += BGViewer_Paint;
2012-03-12 05:26:48 +00:00
}
private void BGViewer_Paint(object sender, PaintEventArgs e)
{
2013-11-20 01:37:54 +00:00
e.Graphics.DrawImageUnscaled(Bat, 0, 0);
2012-03-12 05:26:48 +00:00
}
}
}