Interface IImageService
Represents a service for manipulating images.
Namespace: DataWeb.Media
Assembly: DataWeb.Core.dll
Syntax
public interface IImageService
Properties
Name
Gets the name of the service.
Declaration
string Name { get; }
Property Value
Type |
---|
string |
Methods
CreateThumbnail(File, int, int, ResizeMode)
Creates a thumbnail for the specified file with the specified dimensions and resize mode.
Declaration
Task<bool> CreateThumbnail(File file, int width, int height, ResizeMode resizeMode = ResizeMode.Fix)
Parameters
Type | Name | Description |
---|---|---|
File | file | The File to create the thumbnail for. |
int | width | The desired width of the thumbnail. |
int | height | The desired height of the thumbnail. |
ResizeMode | resizeMode | The ResizeMode of the thumbnail. |
Returns
Type | Description |
---|---|
Task<bool> |
|
DeleteThumbnailsAsync()
Deletes all thumbnails generated by the service.
Declaration
Task DeleteThumbnailsAsync()
Returns
Type | Description |
---|---|
Task |
GetImageFormatAsync(Stream)
Gets the image format of the specified stream.
Declaration
Task<string> GetImageFormatAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to get the image format for. |
Returns
Type | Description |
---|---|
Task<string> | The image format of the specified stream, or |
GetThumbnailStreamAsync(File, int, int, ResizeMode)
Gets a stream containing the thumbnail for the specified file with the specified dimensions and resize mode.
Declaration
Task<Stream> GetThumbnailStreamAsync(File file, int width, int height, ResizeMode resizeMode = ResizeMode.Fix)
Parameters
Type | Name | Description |
---|---|---|
File | file | The File to retrieve the thumbnail for. |
int | width | The desired width of the thumbnail. |
int | height | The desired height of the thumbnail. |
ResizeMode | resizeMode | The ResizeMode of the thumbnail. |
Returns
Type | Description |
---|---|
Task<Stream> | A stream containing the thumbnail for the specified file, or |
IsThumbnailAsync(File, int, int, ResizeMode)
Determines whether the specified file has a thumbnail with the specified dimensions and resize mode.
Declaration
Task<bool> IsThumbnailAsync(File file, int width, int height, ResizeMode resizeMode = ResizeMode.Fix)
Parameters
Type | Name | Description |
---|---|---|
File | file | The File to check. |
int | width | The desired width of the thumbnail. |
int | height | The desired height of the thumbnail. |
ResizeMode | resizeMode | The ResizeMode of the thumbnail. |
Returns
Type | Description |
---|---|
Task<bool> |
|