コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public static void SaveBitmap(this Bitmap bmp, string path, DiscordImageFormat f)
 => BitmapManager.Save(bmp, path, f);
コード例 #4
0
 public static string GetExtensionName(this DiscordImageFormat f)
 => f.ToSystemFormat().GetExtensionName();
コード例 #5
0
 public static void Save(Bitmap bmp, string path, DiscordImageFormat f)
 => Save(bmp, path, f.ToSystemFormat());