Table of Contents

Class GetImageSettings

Namespace
Dynamicweb.Frontend
Assembly
Dynamicweb.dll

Represents the settings for GetImage.ashx link generation.

public sealed class GetImageSettings
Inheritance
GetImageSettings
Inherited Members

Constructors

GetImageSettings()

Initializes a new instance of the GetImageSettings class.

public GetImageSettings()

Properties

Format

Gets or sets the image format.

public ImageType Format { get; set; }

Property Value

ImageType

The image format of the generated image.

Remarks

Default value is WebP

Height

Gets or sets the desired height of the image.

public int? Height { get; set; }

Property Value

int?

The height of the image in pixels, or null if the height is not specified.

Quality

Gets or sets the desired quality of the image.

public int? Quality { get; set; }

Property Value

int?

The Quality of the image in a relative value from 1-100, or null if the quality is not specified.

Remarks

webp supports -1 for lossless transformations. Jpg supports 1-100. Recommended value is 65-75. Invalid values are passed directly to GetImage that will report back errors

Ratio

Gets or sets the ratio required of the generated image.

public string? Ratio { get; set; }

Property Value

string

The ratio either as a fraction (21/9) or a decimal value (2.33).

Remarks

Use together with Width to calculate height based on the specified ratio. If ratio is set, the crop mode will be set to CenterOrFocal. E.g. a ratio of 1/1 will generate a square image, 16/9 will generate a widescreen image, 3/4 will generate a tall image. Using a width of 1280 and a ratio of 16/9 will generate an image with a height of 720 pixels (1280px / (16/9)).

Width

Gets or sets the desired width of the image.

public int? Width { get; set; }

Property Value

int?

The width of the image in pixels, or null if the width is not specified.

crop

Gets or sets the crop mode. The crop mode defines how the image is cropped when resized.

public CropMode? crop { get; set; }

Property Value

CropMode?

A crop mode using a CropMode option

Remarks

Default is null which will translate into KeepAspectRatio when image is generated When using Ratio and Width is set, the crop mode will be set to CenterOrFocal.

To top