ARCed.Helpers.Cache.Battleback C# (CSharp) Method

Battleback() public static method

Loads/recalls a cached battleback file and returns it
public static Battleback ( string filename, int hue, int opacity = 255 ) : Image
filename string Full path of the battleback graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned image
return Image
        public static Image Battleback(string filename, int hue = 0, int opacity = 255)
        {
            var bitmap = LoadBitmap(@"Graphics\Battlebacks", 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);
            }
        }