Esempio n. 1
0
        private static Image GetSprite(PKM pkm, bool isBoxBGRed = false)
        {
            var img = GetSprite(pkm.Species, pkm.AltForm, pkm.Gender, pkm.SpriteItem, pkm.IsEgg, pkm.IsShiny, pkm.Format, isBoxBGRed);

            if (pkm is IShadowPKM s && s.Purification > 0)
            {
                if (pkm.Species == 249) // Lugia
                {
                    img = Spriter.GetSprite(Resources._249x, 249, pkm.HeldItem, pkm.IsEgg, pkm.IsShiny, pkm.Format, isBoxBGRed);
                }
                GetSpriteGlow(pkm, new byte[] { 75, 0, 130 }, out var pixels, out var baseSprite, true);
                var glowImg = ImageUtil.GetBitmap(pixels, baseSprite.Width, baseSprite.Height, baseSprite.PixelFormat);
                img = ImageUtil.LayerImage(glowImg, img, 0, 0);
            }
            return(img);
        }
Esempio n. 2
0
        private static Image GetSprite(PKM pk, bool isBoxBGRed = false)
        {
            var img = GetSprite(pk.Species, pk.AltForm, pk.Gender, pk.SpriteItem, pk.IsEgg, pk.IsShiny, pk.Format, isBoxBGRed);

            if (pk is IShadowPKM s && s.Purification > 0)
            {
                const int Lugia = 249;
                if (pk.Species == Lugia) // show XD shadow sprite
                {
                    img = Spriter.GetSprite(Resources._249x, Lugia, pk.HeldItem, pk.IsEgg, pk.IsShiny, pk.Format, isBoxBGRed);
                }
                GetSpriteGlow(pk, 75, 0, 130, out var pixels, out var baseSprite, true);
                var glowImg = ImageUtil.GetBitmap(pixels, baseSprite.Width, baseSprite.Height, baseSprite.PixelFormat);
                img = ImageUtil.LayerImage(glowImg, img, 0, 0);
            }
            return(img);
        }
Esempio n. 3
0
        public static Bitmap GetBitmap(CGearBackground bg)
        {
            const int Width  = CGearBackground.Width;
            const int Height = CGearBackground.Height;
            Bitmap    img    = new Bitmap(Width, Height, PixelFormat.Format32bppArgb);

            // Fill Data
            using (Graphics g = Graphics.FromImage(img))
                for (int i = 0; i < bg.Map.TileChoices.Length; i++)
                {
                    int    x        = (i * 8) % Width;
                    int    y        = 8 * ((i * 8) / Width);
                    var    tile     = bg.Tiles[bg.Map.TileChoices[i] % bg.Tiles.Length];
                    var    tileData = tile.Rotate(bg.Map.Rotations[i]);
                    Bitmap b        = ImageUtil.GetBitmap(tileData, 8, 8);
                    g.DrawImage(b, new Point(x, y));
                }
            return(img);
        }
Esempio n. 4
0
 public static Bitmap GetBitmap(CGearBackground bg)
 {
     return(ImageUtil.GetBitmap(bg.GetImageData(), CGearBackground.Width, CGearBackground.Height));
 }