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 |
return | 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);
}
}