示例#1
0
        private void ExportGif(string filename)
        {
            uint mapid = this.MapPictureBox.GetMapID();

            if (mapid == U.NOT_FOUND)
            {
                return;
            }
            MapSettingForm.PLists plist = MapSettingForm.GetMapPListsWhereMapID(mapid);
            if (plist.palette_plist == 0)
            {
                return;
            }
            uint palette = MapPointerForm.PlistToOffsetAddr(MapPointerForm.PLIST_TYPE.PALETTE, plist.palette_plist);

            if (palette == U.NOT_FOUND)
            {
                return;
            }
            int palette_index = SamplePaletteComboBox.SelectedIndex;

            if (palette_index < 0)
            {
                palette_index = 0;
            }

            uint addr = InputFormRef.BaseAddress;

            if (!U.isSafetyOffset(addr))
            {
                return;
            }

            //同じアニメを何度も出力しないように記録する.
            List <ImageUtilAnimeGif.Frame> bitmaps = new List <ImageUtilAnimeGif.Frame>();

            for (int i = 0; i < InputFormRef.DataCount; i++, addr += InputFormRef.BlockSize)
            {
                uint wait   = Program.ROM.u16(addr + 0);
                uint length = Program.ROM.u16(addr + 2);
                uint p4     = Program.ROM.p32(addr + 4);
                if (!U.isSafetyOffset(p4))
                {
                    continue;
                }

                MapSettingForm.MapAnimations anime = new MapSettingForm.MapAnimations();
                anime.change_bitmap_bytes = GetTileAnime1(p4, length);

                Bitmap mapBitmap = MapSettingForm.DrawMap(mapid, anime);
                bitmaps.Add(new ImageUtilAnimeGif.Frame(mapBitmap, wait));
            }

            //アニメgif生成
            ImageUtilAnimeGif.SaveAnimatedGif(filename, bitmaps);
            U.SelectFileByExplorer(filename);
        }
示例#2
0
        private void ChangeComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            uint mapid = (uint)MapSelector.SelectedIndex;

            if (IsWorldmap(mapid))
            {//ワールドマップ
                this.MapBitMap = WorldMapImageForm.DrawWorldMap();
                this.Map.Image = MapBitMap;
            }
            else
            {
                this.MapBitMap = MapSettingForm.DrawMap(mapid, this.MapAnime);
                int change = ChangeComboBox.SelectedIndex;
                if (change >= 1)
                {
                    change = change - 1;
                    List <MapChangeForm.ChangeSt> mapchange = MapChangeForm.MakeChangeList(mapid);
                    if (change < mapchange.Count)
                    {
                        Bitmap c = MapSettingForm.DrawMapChange((uint)mapid
                                                                , (int)mapchange[change].width
                                                                , (int)mapchange[change].height
                                                                , mapchange[change].addr
                                                                , this.MapAnime);
                        ImageUtil.BitBlt(this.MapBitMap
                                         , (int)(mapchange[change].x * 16)
                                         , (int)(mapchange[change].y * 16)
                                         , c.Width
                                         , c.Height
                                         , c, 0, 0);
                        c.Dispose();
                    }
                }

                this.Map.Image = MapBitMap;
            }

            ZoomComboBox_SelectedIndexChanged(null, null);
        }