private void button1_Click(object sender, EventArgs e) { MapMarkSelect select = new MapMarkSelect(); select.ShowDialog(); if (select.ActiveImageViewer != null) { selectedMark = select.ActiveImageViewer.Name; MarkPreview.Image = select.ActiveImageViewer.Image; } }
public GetMapInfo(IMGEntry info) { InitializeComponent(); List <string> MusicNames = new List <string>(); lock (MapEditor.SoundLock) { foreach (IMGFile bgms in MapEditor.sound.Directory.IMGs.Values) { if (bgms.Name.Substring(0, 3) == "Bgm") { foreach (IMGEntry sound in bgms.childs.Values) { MusicNames.Add(bgms.Name + "/" + sound.Name); } } } } MusicNames.Sort(); BGMsList.Items.AddRange(MusicNames.ToArray()); BGMsList.SelectedItem = info.GetString("bgm").Replace("/", ".img/"); int returnMap = info.GetInt("returnMap"); if (returnMap == 999999999) { IsReturnMap.Checked = true; ReturnMap.Enabled = false; } else { IsReturnMap.Checked = false; ReturnMap.Enabled = true; } ReturnMap.Text = returnMap.ToString(); IsTown.Checked = info.GetInt("town") == 1; IsSwim.Checked = info.GetInt("swim") == 1; IsMiniMap.Checked = info.parent.GetChild("miniMap") != null; selectedMark = info.GetString("mapMark"); MarkPreview.Image = MapMarkSelect.GetMark(selectedMark); Bitmap background = new Bitmap(800, 600); using (Graphics g = Graphics.FromImage(background)) { foreach (MapBack b in Map.Instance.backs) { b.Draw(g); } } Bitmap thumb = new Bitmap(160, 120); using (Graphics g = Graphics.FromImage(thumb)) { g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(background, 0, 0, 160, 120); g.Dispose(); } BackgroundPreview.Image = thumb; }