moved creation of image to only when parent is a GridItem

This commit is contained in:
Rich 2014-02-14 20:16:41 +00:00
parent bee1332737
commit 60ae2a7ca1

View File

@ -867,10 +867,10 @@ namespace Volian.Controls.Library
// - draw the saved grid image
// - do the the load/reload of the grid
// - set Visible back to true.
System.Drawing.Image img = this.CreateImage();
Visible = false;
if (Parent is GridItem)
{
System.Drawing.Image img = this.CreateImage();
using (Graphics gr = (Parent as GridItem).CreateGraphics())
{
gr.DrawImage(img, Left, Top);