ARCed.Helpers.Cache.Battler C# (CSharp) 메소드

Battler() 공개 정적인 메소드

Loads/recalls a cached image battler file and returns it
public static Battler ( string filename, int hue, int opacity = 255 ) : Image
filename string FullPath of the character graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
리턴 Image
        public static Image Battler(string filename, int hue = 0, int opacity = 255)
        {
            var bitmap = LoadBitmap(@"Graphics\Battlers", filename);
            if (bitmap == null)
                return null;
            using (Image image = new Bitmap(bitmap))
            {
                if (hue != 0)
                    RotateHue(image, hue);
                if (opacity != 255)
                    ChangeOpacity(image, opacity);
                GC.Collect(GC.GetGeneration(image), GCCollectionMode.Forced);
                return new Bitmap(image);
            }
        }