Click or drag to resize
ImageVariantDefinitionExtensionsGenerateVariant Method
Generates an image variant by applying all variant definition filters.

Namespace: CMS.ResponsiveImages
Assembly: CMS.ResponsiveImages (in CMS.ResponsiveImages.dll) Version: 13.0.131
Syntax
C#
public static ImageContainer GenerateVariant(
	this IImageVariantDefinition imageVariantDefinition,
	ImageContainer imageContainer,
	IVariantContext context
)

Parameters

imageVariantDefinition
Type: CMS.ResponsiveImagesIImageVariantDefinition
Image variant definition.
imageContainer
Type: CMS.ResponsiveImagesImageContainer
Source image data.
context
Type: CMS.ResponsiveImagesIVariantContext
Image processing context.

Return Value

Type: ImageContainer
New instance of ImageContainer with transformed image data or null when the definition is not applicable for the provided image.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IImageVariantDefinition. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when either of the parameters is null.
ImageFilterExceptionThrown when an error occurs during a filter application.
See Also