private void picTerrain_Paint(object sender, PaintEventArgs e) { mapTerrainType st = bs_sysTerrainType.Current as mapTerrainType; if (st == null) { return; } st.SetBrush(new Size((int)e.ClipRectangle.Width, (int)e.ClipRectangle.Height), false); e.Graphics.DrawPath(Pens.Black, HexGridPath); if (st.brBackground == null) { Debug.Print("No background for Terrain" + st.LongName); } else { e.Graphics.FillPath(st.brBackground, HexGridPath); } if (st.brForeground == null) { Debug.Print("No Foreground for Terrain" + st.LongName); } else { e.Graphics.FillPath(st.brForeground, HexGridRect); } }