Allow toggling png export

why not; I guess if you don't want the items/reticle and want dat clean "here's my terraforming work"
This commit is contained in:
Kurt
2020-05-09 17:32:15 -07:00
parent d1b7032b79
commit 826ba00fcd
3 changed files with 54 additions and 20 deletions

View File

@@ -456,10 +456,21 @@ private void Menu_SavePNG_Click(object sender, EventArgs e)
if (sfd.ShowDialog() != DialogResult.OK)
return;
var img = (Bitmap)PB_Map.BackgroundImage.Clone();
using var gfx = Graphics.FromImage(img);
gfx.DrawImage(PB_Map.Image, new Point(0, 0));
img.Save(sfd.FileName, ImageFormat.Png);
if (!Menu_SavePNGTerrain.Checked)
{
PB_Map.Image.Save(sfd.FileName, ImageFormat.Png);
}
else if (!Menu_SavePNGItems.Checked)
{
PB_Map.BackgroundImage.Save(sfd.FileName, ImageFormat.Png);
}
else
{
var img = (Bitmap)PB_Map.BackgroundImage.Clone();
using var gfx = Graphics.FromImage(img);
gfx.DrawImage(PB_Map.Image, new Point(0, 0));
img.Save(sfd.FileName, ImageFormat.Png);
}
}
private void PB_Map_MouseDown(object sender, MouseEventArgs e) => ClickMapAt(e, true);