public void Convert(ImageFormatEnum destFormat, int compressionFactor) { ImageFormat systemFormat = ImageFormats.ImageFormatToSystemFormat(destFormat); Image newImage = ImageTools.ConvertImage(fSystemImage, systemFormat, compressionFactor); UpdateSystemImage(newImage); }
public void SaveImageToFile(string filename, int compressionFactor = 80) { string extension = Path.GetExtension(filename); ImageFormat destFormat = ImageFormats.ExtensionToSystemFormat(extension); if (destFormat == null) { destFormat = fSystemImage.RawFormat; extension = ImageFormats.SystemFormatToExtension(destFormat).ToLower(); filename = Path.ChangeExtension(filename, extension); } ImageTools.SaveImageToFile(fSystemImage, filename, destFormat, compressionFactor); }
public static bool IsImageFile(string filename) { string ext = Path.GetExtension(filename); return(ImageFormats.ExtensionToEnum(ext) != ImageFormatEnum.Unknown); }
public string GetImageFormatDescription() { return(ImageFormats.ImageFormatToDescription(GetImageFormat())); }
public ImageFormatEnum GetImageFormat() { return(ImageFormats.SystemFormatToEnum(fSystemImage.RawFormat)); }
public string GetImageExtension() { return(ImageFormats.SystemFormatToExtension(fSystemImage.RawFormat)); }