Class CropExtensions
Defines extensions that allow the application of cropping operations on an Image using Mutate/Clone.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public static class CropExtensions
  Methods
| Improve this Doc View SourceCrop(IImageProcessingContext, Rectangle)
Crops an image to the given rectangle.
Declaration
public static IImageProcessingContext Crop(this IImageProcessingContext source, Rectangle cropRectangle)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IImageProcessingContext | source | The image to crop.  | 
      
| Rectangle | cropRectangle | The Rectangle structure that specifies the portion of the image object to retain.  | 
      
Returns
| Type | Description | 
|---|---|
| IImageProcessingContext | The IImageProcessingContext to allow chaining of operations.  | 
      
Crop(IImageProcessingContext, Int32, Int32)
Crops an image to the given width and height.
Declaration
public static IImageProcessingContext Crop(this IImageProcessingContext source, int width, int height)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IImageProcessingContext | source | The image to resize.  | 
      
| Int32 | width | The target image width.  | 
      
| Int32 | height | The target image height.  | 
      
Returns
| Type | Description | 
|---|---|
| IImageProcessingContext | The IImageProcessingContext to allow chaining of operations.  |