BlobService.GetThumb Method

Namespace:
Weavy.Core.Services
Assembly:
Weavy.Core.dll

GetThumb(Blob, int?, int?, FitMode, ScaleMode, ContentAlignment, Color?, int, int, bool, string)

Returns a thumbnail image for the specified file. The image returned may be smaller than the size requested, depending on the size and aspect ratio of the original image.

public static FileInfo GetThumb(Blob blob, int? width = default(int? ), int? height = default(int? ), FitMode fit = FitMode.Fit, ScaleMode scale = ScaleMode.Down, ContentAlignment align, Color? background = default(Color? ), int quality = 90, int opacity = 100, bool ignoreICC = false, string extension = null)

Parameters

blob
Blob

The blob for which to get a thumbnail image.

width
int?

The maximum width in pixels of the thumbnail.

height
int?

The maximum height in pixels of the thumbnail.

fit
FitMode

The constraint mode, determines how to resolve aspect ratio differences between the requested size and the original file dimensions.

scale
ScaleMode

Controls whether the image is allowed to upscale, downscale, both, or if only the canvas gets to be upscaled.

align
System.Drawing.ContentAlignment

How to align the image when padding or cropping.

background
System.Drawing.Color?

The background color to apply (null for transparency), white will be used for jpg images when background is unspecified.

quality
int

The encoding quality to use, only applies to jpg images.

opacity
int
ignoreICC
bool

If true, the ICC profile of the image will be ignored.

extension
string

File extension used to determine thumbnail format, e.g. .png, null to keep same format as original image.

Returns

System.IO.FileInfo

A System.IO.FileInfo pointing to a thumbnail image of the specified file, or null if no thumbnail was found.