Example #1
0
        private void ImportImage4BPP_Load(object sender, EventArgs e)
        {
            this._owner = (MinimapEditor)Owner;

            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Title  = "Select an Indexed Bitmap Image 4BPP";
            ofd.Filter = "Bitmap (.bmp)|*.bmp";
            DialogResult result = ofd.ShowDialog();

            if (result == DialogResult.OK)
            {
                try
                {
                    m_ImageName = ofd.FileName;
                    m_Image     = new Bitmap(m_ImageName);

                    gridImage.Img = m_Image;

                    LoadImageInGrid();

                    m_ImageLoaded = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("There was an error opeing the image:\n\n" +
                                    ofd.FileName + "\n\n" + ex.Message);
                    this.Close();
                }
            }
        }
Example #2
0
        private void ImportImage4BPP_Load(object sender, EventArgs e)
        {
            this._owner = (MinimapEditor)Owner;

            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Title = "Select an Indexed Bitmap Image 4BPP";
            ofd.Filter = "Bitmap (.bmp)|*.bmp";
            DialogResult result = ofd.ShowDialog();
            if (result == DialogResult.OK)
            {
                try
                {
                    m_ImageName = ofd.FileName;
                    m_Image = new Bitmap(m_ImageName);

                    gridImage.Img = m_Image;

                    LoadImageInGrid();

                    m_ImageLoaded = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("There was an error opeing the image:\n\n" +
                        ofd.FileName + "\n\n" + ex.Message);
                    this.Close();
                }
            }
        }