improved life cycle management of picturebox images (dont we have some direct substitute for picturebox which doesnt suck so much?)
This commit is contained in:
parent
6ad6126536
commit
dd8638ba06
|
@ -53,9 +53,23 @@ namespace BizHawk.Client.EmuHawk
|
|||
bmp.SetPixel(i, j, col);
|
||||
}
|
||||
}
|
||||
|
||||
if (pictureBox1.Image != null) pictureBox1.Image.Dispose();
|
||||
pictureBox1.Image = bmp;
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
if (pictureBox1.Image != null)
|
||||
{
|
||||
pictureBox1.Image.Dispose();
|
||||
pictureBox1.Image = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void buttonPal_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog
|
||||
|
|
Loading…
Reference in New Issue