Class ImageConverter
- Namespace
- Dynamicweb.Imaging.Image
Handling
- Assembly
- Dynamicweb.Core.dll
Applies transformations to images based on parameters
- Inheritance
-
Image
Converter
- Inherited Members
Constructors
ImageConverter()
Creates new instance of this class.
ImageConverter(string)
Creates new instance of this class.
Parameters
sourceFile
stringThe virtual path to the image to be converted.
Properties
Parameters
Gets or sets the ConvertParameters object for this instance.
Property Value
Methods
ColorModeFromString(string)
Colors the mode from string.
Parameters
mode
stringThe color mode as string.
Returns
Convert(ConvertParameters)
Converts the image and returns the contents of the converted image.
Parameters
convertParameters
ConvertParameters The conversion parameters.
Returns
- byte[]
The contents of the converted image.
Exceptions
- Convert
Exception Thrown when unable to process the image file using the given parameters.
Convert(string, string, int)
Converts the image.
Parameters
fromFile
stringThe virtual path to the source file.
toFile
stringThe virtual path to the destination file.
width
intThe width of the image.
Convert(string, string, int, int)
Converts the image.
Parameters
fromFile
stringThe virtual path to the source file.
toFile
stringThe virtual path to the destination file.
width
intThe width of the image.
height
intThe height of the image.
Convert(string, string, int, int, OutputFormat)
Converts the image.
public static void Convert(string fromFile, string toFile, int width, int height, OutputFormat format)
Parameters
fromFile
stringThe virtual path to the source file.
toFile
stringThe virtual path to the destination file.
width
intThe width of the image.
height
intThe height of the image.
format
OutputFormat The format of the image.
Exceptions
- Convert
Exception Thrown when toFile already exists or any of files destinations are not specified
ConvertToFile(string)
Converts the source image according to conversion parameters.
Parameters
filePath
stringThe virtual path to the destination file.
Exceptions
- Convert
Exception Thrown when file already exists
GetOutputFileName(ConvertParameters)
Gets the name of the output file.
Parameters
convertParameters
ConvertParameters The convertParameters.
Returns
OutputFormatFromString(string)
Outputs the format from string.
Parameters
format
stringThe output format.
Returns
Resize(string, int)
Resizes the image.
Parameters
Resize(string, int, int)
Resize the image.
Parameters
fromFile
stringThe virtual path to the source file.
width
intThe width of the image.
height
intThe height of the image.
Resize(string, int, int, OutputFormat)
Resize the image.
Parameters
fromFile
stringThe virtual path to the source file.
width
intThe width of the image.
height
intThe height of the image.
format
OutputFormat The format of the image.
Exceptions
- Convert
Exception Thrown when file cannot be found
StringFromColorMode(ColorMode)
Strings from color mode.
Parameters
mode
ColorMode The mode.
Returns
StringFromOutputFormat(OutputFormat)
Strings from output format.
Parameters
currentFormat
OutputFormat The format.