Class ResizeExtensions
- Namespace
- SixLabors.ImageSharp.Processing
- Assembly
- SixLabors.ImageSharp.dll
Defines extensions that allow the application of resize operations on an Image using Mutate/Clone.
public static class ResizeExtensions
- Inheritance
-
ResizeExtensions
- Inherited Members
Methods
Resize(IImageProcessingContext, ResizeOptions)
Resizes an image in accordance with the given ResizeOptions.
public static IImageProcessingContext Resize(this IImageProcessingContext source, ResizeOptions options)
Parameters
source
IImageProcessingContextThe current image processing context.
options
ResizeOptionsThe resize options.
Returns
Remarks
Passing zero for one of height or width within the resize options will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, Size)
Resizes an image to the given Size.
public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size)
Parameters
source
IImageProcessingContextThe current image processing context.
size
SizeThe target image size.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, Size, IResampler, bool)
Resizes an image to the given width and height with the given sampler.
public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size, IResampler sampler, bool compand)
Parameters
source
IImageProcessingContextThe current image processing context.
size
SizeThe target image size.
sampler
IResamplerThe IResampler to perform the resampling.
compand
boolWhether to compress and expand the image color-space to gamma correct the image during processing.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, Size, bool)
Resizes an image to the given Size.
public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size, bool compand)
Parameters
source
IImageProcessingContextThe current image processing context.
size
SizeThe target image size.
compand
boolWhether to compress and expand the image color-space to gamma correct the image during processing.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, int, int)
Resizes an image to the given width and height.
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height)
Parameters
source
IImageProcessingContextThe current image processing context.
width
intThe target image width.
height
intThe target image height.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, int, int, IResampler)
Resizes an image to the given width and height with the given sampler.
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler)
Parameters
source
IImageProcessingContextThe current image processing context.
width
intThe target image width.
height
intThe target image height.
sampler
IResamplerThe IResampler to perform the resampling.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, int, int, IResampler, Rectangle, Rectangle, bool)
Resizes an image to the given width and height with the given sampler and source rectangle.
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand)
Parameters
source
IImageProcessingContextThe current image processing context.
width
intThe target image width.
height
intThe target image height.
sampler
IResamplerThe IResampler to perform the resampling.
sourceRectangle
RectangleThe Rectangle structure that specifies the portion of the image object to draw.
targetRectangle
RectangleThe Rectangle structure that specifies the portion of the target image object to draw to.
compand
boolWhether to compress and expand the image color-space to gamma correct the image during processing.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, int, int, IResampler, Rectangle, bool)
Resizes an image to the given width and height with the given sampler and source rectangle.
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand)
Parameters
source
IImageProcessingContextThe current image processing context.
width
intThe target image width.
height
intThe target image height.
sampler
IResamplerThe IResampler to perform the resampling.
targetRectangle
RectangleThe Rectangle structure that specifies the portion of the target image object to draw to.
compand
boolWhether to compress and expand the image color-space to gamma correct the image during processing.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, int, int, IResampler, bool)
Resizes an image to the given width and height with the given sampler.
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, bool compand)
Parameters
source
IImageProcessingContextThe current image processing context.
width
intThe target image width.
height
intThe target image height.
sampler
IResamplerThe IResampler to perform the resampling.
compand
boolWhether to compress and expand the image color-space to gamma correct the image during processing.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.
Resize(IImageProcessingContext, int, int, bool)
Resizes an image to the given width and height.
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, bool compand)
Parameters
source
IImageProcessingContextThe current image processing context.
width
intThe target image width.
height
intThe target image height.
compand
boolWhether to compress and expand the image color-space to gamma correct the image during processing.
Returns
Remarks
Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio.