Class PadExtensions
Defines extensions that allow the application of padding operations on an Image using Mutate/Clone.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public static class PadExtensions
Methods
| Improve this Doc View SourcePad(IImageProcessingContext, Int32, Int32)
Evenly pads an image to fit the new dimensions.
Declaration
public static IImageProcessingContext Pad(this IImageProcessingContext source, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The source image to pad. |
Int32 | width | The new width. |
Int32 | height | The new height. |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
Pad(IImageProcessingContext, Int32, Int32, Color)
Evenly pads an image to fit the new dimensions with the given background color.
Declaration
public static IImageProcessingContext Pad(this IImageProcessingContext source, int width, int height, Color color)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The source image to pad. |
Int32 | width | The new width. |
Int32 | height | The new height. |
Color | color | The background color with which to pad the image. |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |