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
sourceIImageProcessingContextThe current image processing context.
optionsResizeOptionsThe 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
sourceIImageProcessingContextThe current image processing context.
sizeSizeThe 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
sourceIImageProcessingContextThe current image processing context.
sizeSizeThe target image size.
samplerIResamplerThe IResampler to perform the resampling.
compandboolWhether 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
sourceIImageProcessingContextThe current image processing context.
sizeSizeThe target image size.
compandboolWhether 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
sourceIImageProcessingContextThe current image processing context.
widthintThe target image width.
heightintThe 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
sourceIImageProcessingContextThe current image processing context.
widthintThe target image width.
heightintThe target image height.
samplerIResamplerThe 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
sourceIImageProcessingContextThe current image processing context.
widthintThe target image width.
heightintThe target image height.
samplerIResamplerThe IResampler to perform the resampling.
sourceRectangleRectangleThe Rectangle structure that specifies the portion of the image object to draw.
targetRectangleRectangleThe Rectangle structure that specifies the portion of the target image object to draw to.
compandboolWhether 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
sourceIImageProcessingContextThe current image processing context.
widthintThe target image width.
heightintThe target image height.
samplerIResamplerThe IResampler to perform the resampling.
targetRectangleRectangleThe Rectangle structure that specifies the portion of the target image object to draw to.
compandboolWhether 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
sourceIImageProcessingContextThe current image processing context.
widthintThe target image width.
heightintThe target image height.
samplerIResamplerThe IResampler to perform the resampling.
compandboolWhether 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
sourceIImageProcessingContextThe current image processing context.
widthintThe target image width.
heightintThe target image height.
compandboolWhether 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.