public static SystemImageFormat ToSystemFormat(this DiscordImageFormat f) { switch (f) { case DiscordImageFormat.Gif: return(SystemImageFormat.Gif); case DiscordImageFormat.Jpeg: return(SystemImageFormat.Jpeg); default: return(SystemImageFormat.Png); } }
public void SaveAs(Bitmap b, string path, Discord.ImageFormat f) { ImageFormat tmp; switch (f) { case Discord.ImageFormat.Jpeg: tmp = ImageFormat.Jpeg; break; case Discord.ImageFormat.Gif: tmp = ImageFormat.Gif; break; default: tmp = ImageFormat.Png; break; } SaveAs(b, path, tmp); }
public static void SaveBitmap(this Bitmap bmp, string path, DiscordImageFormat f) => BitmapManager.Save(bmp, path, f);
public static string GetExtensionName(this DiscordImageFormat f) => f.ToSystemFormat().GetExtensionName();
public static void Save(Bitmap bmp, string path, DiscordImageFormat f) => Save(bmp, path, f.ToSystemFormat());