Class ImageExtensions
public static class ImageExtensions
- Inheritance
-
ImageExtensions
- Inherited Members
Methods
GetFlippedHorizontallyAsync(ImageDocument, IPrincipal?, CancellationToken?, DocumentAccessRule?)
Retrieve a copy of the image flipped on the Y axis
public static Task<ImageDocument> GetFlippedHorizontallyAsync(this ImageDocument source, IPrincipal? principal = null, CancellationToken? cancellationToken = null, DocumentAccessRule? access = null)
Parameters
sourceImageDocumentprincipalIPrincipalcancellationTokenCancellationToken?accessDocumentAccessRule
Returns
GetFlippedVerticallyAsync(ImageDocument, IPrincipal?, CancellationToken?, DocumentAccessRule?)
Retrieve a copy of the image flipped on the Y axis
public static Task<ImageDocument> GetFlippedVerticallyAsync(this ImageDocument source, IPrincipal? principal = null, CancellationToken? cancellationToken = null, DocumentAccessRule? access = null)
Parameters
sourceImageDocumentprincipalIPrincipalcancellationTokenCancellationToken?accessDocumentAccessRule
Returns
GetRotationAsync(ImageDocument, int, IPrincipal?, CancellationToken?, DocumentAccessRule?)
Retrieve a copy of the image rotated 90 clockwise the specified number of times.
public static Task<ImageDocument> GetRotationAsync(this ImageDocument source, int rotation, IPrincipal? principal = null, CancellationToken? cancellationToken = null, DocumentAccessRule? access = null)
Parameters
sourceImageDocumentrotationintThe number of 90-degree clockwise rotations to apply.
principalIPrincipalcancellationTokenCancellationToken?accessDocumentAccessRule
Returns
GetThumbnailAsync(ImageDocument, int?, int?, string?, IPrincipal?, CancellationToken?)
Retrieve or create a thumbnail that will fit the given bounds and optionally has the desired MIME type
public static Task<ImageDocument> GetThumbnailAsync(this ImageDocument source, int? maxWidth, int? maxHeight, string? targetMimeType = null, IPrincipal? principal = null, CancellationToken? cancellationToken = null)
Parameters
sourceImageDocumentmaxWidthint?Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.
maxHeightint?Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.
targetMimeTypestringThe desired MIME type of the thumbnail. If null is passed, the source image's MIME type is used.
principalIPrincipalcancellationTokenCancellationToken?
Returns
GetThumbnailAsync(ImageDocument, ImageMetadata, int?, int?, string?, IPrincipal?, CancellationToken?)
Retrieve or create a thumbnail that will fit the given bounds and optionally has the desired MIME type
public static Task<ImageDocument> GetThumbnailAsync(this ImageDocument source, ImageMetadata metadata, int? maxWidth, int? maxHeight, string? targetMimeType = null, IPrincipal? principal = null, CancellationToken? cancellationToken = null)
Parameters
sourceImageDocumentmetadataImageMetadataPre-loaded metadata containing existing thumbnails.
maxWidthint?Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.
maxHeightint?Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.
targetMimeTypestringThe desired MIME type of the thumbnail. If null is passed, the source image's MIME type is used.
principalIPrincipalcancellationTokenCancellationToken?