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); }
public static void Encode(this IImageCodec imageCodec, IImage image, Stream stream) { imageCodec.Encode(image, stream, ImageEncoderOptions.Default); }
public static void Encode(this IImageCodec imageCodec, IImage image, string filePath) { imageCodec.Encode(image, filePath, ImageEncoderOptions.Default); }