Ejemplo n.º 1
0
        private void mnuExport_Click(object sender, EventArgs e)
        {
            string filter = null, title = null;

            switch (this.OutMode)
            {
            case DumpTypes.Gfx:
                title  = "Save image as...";
                filter = "PNG|*.png|GIF|*.gif|BMP|*.bmp|JPEG|*.jpg";
                break;

            case DumpTypes.Raw:
            case DumpTypes.Text:
                title  = "Save text as...";
                filter = "Text file|*.txt";
                break;

            default:
                Program.Alert("current unsupported");
                break;
            }

            var savefile = ChooseFile.Save(title, this.Image.SoftwareTitle + " - " + this.CurrentChunk.Info.Addr.StartOffset + "-" + this.CurrentChunk.Info.Addr.EndOffset, null, filter);

            if (savefile == null)
            {
                return;
            }
            if (this.OutMode == DumpTypes.Gfx)
            {
                switch (Path.GetExtension(savefile).ToLower())
                {
                case ".png":
                    this.dispOut.OutPic.Save(savefile, System.Drawing.Imaging.ImageFormat.Png);
                    break;

                case ".gif":
                    this.dispOut.OutPic.Save(savefile, System.Drawing.Imaging.ImageFormat.Gif);
                    break;

                case ".bmp":
                    this.dispOut.OutPic.Save(savefile, System.Drawing.Imaging.ImageFormat.Bmp);
                    break;

                case ".jpg":
                case ".jpeg":
                    this.dispOut.OutPic.Save(savefile, System.Drawing.Imaging.ImageFormat.Jpeg);
                    break;

                default:
                    Program.Alert("current unsupported");
                    break;
                }
            }
            else
            {
                File.WriteAllText(savefile, this.dispOut.OutText);
            }
        }
Ejemplo n.º 2
0
        private void mnuExportRaw_Click(object sender, EventArgs e)
        {
            var savefile = ChooseFile.Save("Save data chunk as...", this.Image.SoftwareTitle + " - " + this.CurrentChunk.Info.Addr.StartOffset + "-" + this.CurrentChunk.Info.Addr.EndOffset, null, "All files|*.*");

            if (savefile == null)
            {
                return;
            }
            File.WriteAllBytes(savefile, this.CurrentChunk.Data);
        }
Ejemplo n.º 3
0
        private void mnuPaletteOpen_Click(object sender, EventArgs e)
        {
            var _temp = ChooseFile.Open("Select a palette file", null, null, "ZSNES Savestate|*.zs?|Gens savestate|*.gs?|TileLayer Palette|*.tpl|All files|*.*");

            if (_temp == null)
            {
                return;
            }

            this.ColorsDock.AddPalette(_temp);
        }
Ejemplo n.º 4
0
 private void mnuImageOpen_Click(object sender, EventArgs e)
 {
     try
     {
         var _temp = ChooseFile.Open("Select a media image", null, null, "All files|*.*|Super Famicom/SNES|*.smc;*.sfc|Megadrive/Genesis|*.smd;*.gen|GameGear|*.gg|Master System|*.sms|Super 32X|*.32x|Gameboy/GB Color|*.gb;*.gbc|Gameboy Advance|*.gba");
         if (_temp == null)
         {
             return;
         }
         this.OpenImage(_temp);
     }
     catch (Exception err)
     {
         Program.ExH.Summary(err);
     }
 }
Ejemplo n.º 5
0
        private void mnuMapOpen_Click(object sender, EventArgs e)
        {
            try
            {
                var _temp = ChooseFile.Open("Select an image map", null, null, "Image Map|*.imp|All files|*.*");
                if (_temp == null)
                {
                    return;
                }

                this.MapDock.AddMap(_temp);
            }
            catch (Exception err)
            {
                Program.ExH.Summary(err);
            }
        }
Ejemplo n.º 6
0
        private void mnuTableOpen_Click(object sender, EventArgs e)
        {
            try
            {
                var _temp = ChooseFile.Open("Select a text table", null, null, "Text table (Nightcrawler spec)|*.tbl|All files|*.*");
                if (_temp == null)
                {
                    return;
                }

                this.TextDock.AddTable(_temp);
            }
            catch (Exception err)
            {
                Program.ExH.Summary(err);
            }
        }