public static byte[] GetAnimationPicToByteArray(int index)
        {
            byte[] getAnimationPicToByteArrayRet = default;
            var    sOffset   = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + index * 8; // Pointer to Pokemon front sprites, + 8 = Bulbasaur.
            var    pOffset   = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + index * 8;  // Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
            var    temp      = new byte[4096];
            var    image     = new byte[65536];
            var    palette15 = new byte[4096];

            Color[] palette32;
            Bitmap  bSprite;

            using (var fs = new FileStream(MainObject.LoadedRom, FileMode.Open, FileAccess.Read))
            {
                using var r = new BinaryReader(fs);
                fs.Position = sOffset;
                sOffset     = r.ReadInt32() - 0x8000000;
                fs.Position = sOffset;
                r.Read(temp, 0, 0xFFF);
                Lz77.Lz77UnComp(temp, image);
                temp        = new byte[4096];
                fs.Position = pOffset;
                pOffset     = r.ReadInt32() - 0x8000000;
                fs.Position = pOffset;
                r.Read(temp, 0, 0xFFF);
                Lz77.Lz77UnComp(temp, palette15);
                palette32 = LoadPalette(palette15);
            }

            bSprite = LoadSprite(ref image, palette32, 64, 128, Conversions.ToBoolean(0));
            WichuSpriteFunctions.LoadBitmapFromArray(ref image, ref palette32, ref bSprite, 64, 128);
            // bSprite = LoadSprite(Image, Palette32, 64, 64, 0)
            getAnimationPicToByteArrayRet = (byte[])WichuSpriteFunctions.SaveBitmapToArray(ref bSprite, ref palette32);
            return(getAnimationPicToByteArrayRet);
        }
        public static Bitmap GetAndDrawTrainerSpriteToBitmap(int index, bool showBackColor = false)
        {
            Bitmap getAndDrawTrainerSpriteToBitmapRet = default;
            var    sOffset   = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TrainerImageTable", ""), System.Globalization.NumberStyles.HexNumber) + index * 8;
            var    pOffset   = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TrainerPaletteTable", ""), System.Globalization.NumberStyles.HexNumber) + index * 8;
            var    temp      = new byte[4096];
            var    image     = new byte[65536];
            var    palette15 = new byte[4096];

            Color[] palette32;
            Bitmap  bSprite;

            using (var fs = new FileStream(MainObject.LoadedRom, FileMode.Open, FileAccess.Read))
            {
                using var r = new BinaryReader(fs);
                fs.Position = sOffset;
                sOffset     = r.ReadInt32() - 0x8000000;
                fs.Position = sOffset;
                r.Read(temp, 0, 0xFFF);
                Lz77.Lz77UnComp(temp, image);
                temp        = new byte[4096];
                fs.Position = pOffset;
                pOffset     = r.ReadInt32() - 0x8000000;
                fs.Position = pOffset;
                r.Read(temp, 0, 0xFFF);
                Lz77.Lz77UnComp(temp, palette15);
                palette32 = LoadPalette(palette15);
            }

            bSprite = LoadSprite(ref image, palette32, 64, 64, showBackColor);
            getAndDrawTrainerSpriteToBitmapRet = bSprite;
            return(getAndDrawTrainerSpriteToBitmapRet);
        }
        public static Bitmap GetShinyAnimationPokemonPicToBitmap(int index, bool showBackColor = true)
        {
            Bitmap getShinyAnimationPokemonPicToBitmapRet = default;
            var    sOffset   = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + index * 8; // Pointer to Pokemon front sprites, + 8 = Bulbasaur.
            var    pOffset   = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + index * 8;   // Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
            var    temp      = new byte[4096];
            var    image     = new byte[65536];
            var    palette15 = new byte[4096];

            Color[] palette32;
            Bitmap  bSprite;

            using (var fs = new FileStream(MainObject.LoadedRom, FileMode.Open, FileAccess.Read))
            {
                using var r = new BinaryReader(fs);
                fs.Position = sOffset;
                sOffset     = r.ReadInt32() - 0x8000000;
                fs.Position = sOffset;
                r.Read(temp, 0, 0xFFF);
                Lz77.Lz77UnComp(temp, image);
                temp        = new byte[4096];
                fs.Position = pOffset;
                pOffset     = r.ReadInt32() - 0x8000000;
                fs.Position = pOffset;
                r.Read(temp, 0, 0xFFF);
                Lz77.Lz77UnComp(temp, palette15);
                palette32 = LoadPalette(palette15);
            }

            bSprite = LoadSprite(ref image, palette32, 64, 128, showBackColor);
            getShinyAnimationPokemonPicToBitmapRet = bSprite;
            return(getShinyAnimationPokemonPicToBitmapRet);
        }