ARCed.Helpers.Cache.CharacterStance C# (CSharp) Метод

CharacterStance() публичный статический Метод

Returns a tile of a character graphic using the given pattern and direction
public static CharacterStance ( string filename, int pattern, int direction, int hue, int opacity = 255 ) : Image
filename string FullPath of the character graphic
pattern int Pattern of the character tile
direction int Direction of the character tile
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
Результат Image
        public static Image CharacterStance(string filename, int pattern, int direction,
            int hue = 0, int opacity = 255)
        {
            var image = Character(filename, hue, opacity);
            var cw = image.Width / 4;
            var ch = image.Height / 4;
            var sx = pattern * cw;
            var sy = (direction - 2) / 2 * ch;
            var tile = new Bitmap(cw, ch);
            using (var g = Graphics.FromImage(tile))
                g.DrawImage(image, new Rectangle(0, 0, cw, ch), sx, sy, cw, ch, GraphicsUnit.Pixel);
            GC.Collect(GC.GetGeneration(image), GCCollectionMode.Forced);
            return tile;
        }