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
Pad(IImageProcessingContext, int, int)
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 current image processing context. |
| int | width | The new width. |
| int | height | The new height. |
Returns
| Type | Description |
|---|---|
| IImageProcessingContext |
Pad(IImageProcessingContext, int, int, 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 current image processing context. |
| int | width | The new width. |
| int | height | The new height. |
| Color | color | The background color with which to pad the image. |
Returns
| Type | Description |
|---|---|
| IImageProcessingContext |