private void Menu_SavePNG_Click(object sender, EventArgs e) { var pb = WinFormsUtil.GetUnderlyingControl <PictureBox>(sender); if (pb?.Image == null) { WinFormsUtil.Alert(MessageStrings.MsgNoPictureLoaded); return; } const string name = "map"; var bmp = FieldItemSpriteDrawer.GetBitmapItemLayer(Map.Items.Layer1); using var sfd = new SaveFileDialog { Filter = "png file (*.png)|*.png|All files (*.*)|*.*", FileName = $"{name}.png", }; if (sfd.ShowDialog() != DialogResult.OK) { return; } bmp.Save(sfd.FileName, ImageFormat.Png); }
private Bitmap GetMapWithReticle(int topX, int topY, int t, FieldItemLayer layer) { return(FieldItemSpriteDrawer.GetBitmapItemLayer(layer, topX, topY, PixelsItemMap, MapReticle, t)); }