Table of Contents

Interface IResizeSettings

Namespace
ToSic.Sxc.Images
Assembly
ToSic.Sxc.dll

Settings how to resize an image for the src or srcset attributes.

It's read only, to create it, use the IImageService

Stores a full configuration for resizing.

This is mainly important for scenarios where you need to build complex rules for the resizer, or for internal functionality when generating images and pictures.

Test

Tip

We suggest you read the Image Guide for maximum power!

📔 Images Guide (Best Practices & Code)

[PublicApi("Still WIP")]
public interface IResizeSettings

Remarks

History: Released 2sxc 13.10

Properties

AspectRatio

The aspect ratio to determine the height, in case no height was specified.

double AspectRatio { get; }

Property Value

double

BasedOn

Name of the original settings it was based on - can be null/empty.

string BasedOn { get; }

Property Value

string

Remarks

New v17.03

Factor

The resize factor by which the original value (width/height) is scaled

double Factor { get; }

Property Value

double

Format

Target format like 'jpg' or 'png'. If empty will not be used.

string Format { get; }

Property Value

string

Height

Height to resize to. If 0, height will not be changed

int Height { get; }

Property Value

int

Parameters

Additional url parameters in case the final link would need this. Rarely used, but can be used for resize parameters which are not standard.

NameValueCollection Parameters { get; }

Property Value

NameValueCollection

Quality

Quality factor for image formats which support quality. Usually a value between 0 and 100. If 0, quality will not be changed.

int Quality { get; }

Property Value

int

ResizeMode

Resize mode. If empty or "(none)" will not be used.

string ResizeMode { get; }

Property Value

string

ScaleMode

Scale Mode. If empty or "(none)" will not be used.

string ScaleMode { get; }

Property Value

string

Width

Width to resize to. If 0, width will not be changed

int Width { get; }

Property Value

int