Пример #1
0
        public static void Encode(this IImageCodec imageCodec, IImage image, string filePath, IImageEncoderOptions options)
        {
            if (!imageCodec.IsSupportedFileFormat(filePath))
            {
                throw new FileFormatException(IO.Properties.ExceptionMessages.UnsupportedFileFormat);
            }

            using (FileStream fs = File.Open(filePath, FileMode.OpenOrCreate))
                imageCodec.Encode(image, fs, options);
        }
Пример #2
0
 public static void Encode(this IImageCodec imageCodec, IImage image, Stream stream)
 {
     imageCodec.Encode(image, stream, ImageEncoderOptions.Default);
 }
Пример #3
0
 public static void Encode(this IImageCodec imageCodec, IImage image, string filePath)
 {
     imageCodec.Encode(image, filePath, ImageEncoderOptions.Default);
 }