Class ImageTagHelper
A
Namespace: SixLabors.ImageSharp.Web.TagHelpers
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public class ImageTagHelper : UrlResolutionTagHelper
Constructors
| Improve this Doc View SourceImageTagHelper(IOptions<ImageSharpMiddlewareOptions>, RequestAuthorizationUtilities, IUrlHelperFactory, HtmlEncoder)
Initializes a new instance of the ImageTagHelper class.
Declaration
public ImageTagHelper(IOptions<ImageSharpMiddlewareOptions> options, RequestAuthorizationUtilities authorizationUtilities, IUrlHelperFactory urlHelperFactory, HtmlEncoder htmlEncoder)
Parameters
Type | Name | Description |
---|---|---|
IOptions<ImageSharpMiddlewareOptions> | options | The middleware configuration options. |
RequestAuthorizationUtilities | authorizationUtilities | Contains helpers that allow authorization of image requests. |
IUrlHelperFactory | urlHelperFactory | The URL helper factory. |
HtmlEncoder | htmlEncoder | The HTML encorder. |
Properties
| Improve this Doc View SourceAnchorPosition
Gets or sets the anchor position.
Declaration
public AnchorPositionMode? AnchorPosition { get; set; }
Property Value
Type | Description |
---|---|
Nullable<AnchorPositionMode> |
AutoOrient
Gets or sets a value indicating whether to automatically rotate/flip the iput image based on embedded EXIF orientation property values before processing.
Declaration
public bool? AutoOrient { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Boolean> |
BackgroundColor
Gets or sets the background color of the image.
Declaration
public Color? BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Color> |
Center
Gets or sets the center coordinates.
Declaration
public PointF? Center { get; set; }
Property Value
Type | Description |
---|---|
Nullable<PointF> |
Compand
Gets or sets a value indicating whether to compress or expand individual pixel colors values on processing.
Declaration
public bool? Compand { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Boolean> |
Format
Gets or sets the image format to convert to.
Declaration
public FormatCommand? Format { get; set; }
Property Value
Type | Description |
---|---|
Nullable<FormatCommand> |
Height
Gets or sets the height in pixel units.
Declaration
public int? Height { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
Remarks
Passed through to the generated HTML in all cases.
Order
Declaration
public override int Order { get; }
Property Value
Type | Description |
---|---|
Int32 |
Orient
Gets or sets a value indicating whether to factor embedded EXIF orientation property values during processing.
Declaration
public bool? Orient { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Boolean> |
Remarks
Defaults to true.
PadColor
Gets or sets the color to use as a background when padding an image.
Declaration
public Color? PadColor { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Color> |
Quality
Gets or sets the quality, that will be used to encode the image. Quality index must be between 0 and 100 (compression from max to min).
Declaration
public int? Quality { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
ResizeMode
Gets or sets the resize mode.
Declaration
public ResizeMode? ResizeMode { get; set; }
Property Value
Type | Description |
---|---|
Nullable<ResizeMode> |
Sampler
Gets or sets the sampling algorithm to use when resizing images.
Declaration
public ResamplerCommand? Sampler { get; set; }
Property Value
Type | Description |
---|---|
Nullable<ResamplerCommand> |
Src
Gets or sets the src.
Declaration
public string? Src { get; set; }
Property Value
Type | Description |
---|---|
Nullable<String> |
Remarks
Passed through to the generated HTML in all cases.
Width
Gets or sets the width in pixel units.
Declaration
public int? Width { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
Remarks
Passed through to the generated HTML in all cases.
Methods
| Improve this Doc View SourceAddProcessingCommands(TagHelperContext, TagHelperOutput, CommandCollection, CultureInfo)
Allows the addition of processing commands by inheriting classes.
Declaration
protected virtual void AddProcessingCommands(TagHelperContext context, TagHelperOutput output, CommandCollection commands, CultureInfo commandCulture)
Parameters
Type | Name | Description |
---|---|---|
TagHelperContext | context | Contains information associated with the current HTML tag. |
TagHelperOutput | output | A stateful HTML element used to generate an HTML tag. |
CommandCollection | commands | The command collection. |
CultureInfo | commandCulture | The culture to use when generating and processing commands. |
Process(TagHelperContext, TagHelperOutput)
Declaration
public override void Process(TagHelperContext context, TagHelperOutput output)
Parameters
Type | Name | Description |
---|---|---|
TagHelperContext | context | |
TagHelperOutput | output |