Esempio n. 1
0
 //////////////////////////////////////////////////////////////////////////////////////////////////////
 // Extraer fichero GIM como PNG
 //////////////////////////////////////////////////////////////////////////////////////////////////////
 private void saveToPNGToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (saveFileDialog.ShowDialog() == DialogResult.OK)
     {
         Bitmap gim = GIM.Decode(Files[listBox.SelectedIndex].buffer);
         gim.Save(saveFileDialog.FileName);
     }
 }
Esempio n. 2
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        // Ver fichero GIM
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        private void viewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Bitmap preview = GIM.Decode(Files[listBox.SelectedIndex].buffer);

            pictureBox.Width           = preview.Width;
            pictureBox.Height          = preview.Height;
            pictureBox.Image           = preview;
            pictureBox.BackgroundImage = null;
        }
Esempio n. 3
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        // Convertir fichero GIM a PNG
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        private void buttonConvert_Click(object sender, EventArgs e)
        {
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                BinaryReader file = new BinaryReader(File.Open(openFileDialog.FileName, FileMode.Open));

                if (file.ReadUInt32() != 0x2E47494D) // 4D 49 47 2E
                {
                    MessageBox.Show("Incorrect header. Correct file?"); file.Close(); return;
                }
                file.Close();

                string inf  = openFileDialog.FileName;
                string outf = Path.ChangeExtension(openFileDialog.FileName, ".png");

                Bitmap preview = GIM.Decode(inf);
                preview.Save(outf);

                pictureBox.Width           = preview.Width;
                pictureBox.Height          = preview.Height;
                pictureBox.Image           = preview;
                pictureBox.BackgroundImage = null;
            }
        }