Example #1
0
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.Filter = "Map|*.map";
            openFileDialog1.Title = "Select a Map File";

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                System.IO.FileStream fs =
                    (System.IO.FileStream)openFileDialog1.OpenFile();
                var bformatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();

                tileMap = (TileMap)bformatter.Deserialize(fs);
                fs.Close();
                pictureBox3.Image = tileMap.GetMap();

            }
        }
Example #2
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     New newForm = new New();
     if (newForm.ShowDialog() == DialogResult.OK)
     {
         tileMap = new TileMap(newForm.height, newForm.width);
         pictureBox3.Image = tileMap.GetMap();
     }
 }