Method CreateBitmapClipper
- Namespace
- PaintDotNet.Imaging
- Assembly
- PaintDotNet.Windows.Core.dll
CreateBitmapClipper<TPixel>(IImagingFactory, IBitmapSource<TPixel>, RectInt32)
public static IBitmapSource<TPixel> CreateBitmapClipper<TPixel>(this IImagingFactory factory, IBitmapSource<TPixel> source, RectInt32 rect) where TPixel : unmanaged, INaturalPixelInfo
Parameters
factoryIImagingFactorysourceIBitmapSource<TPixel>rectRectInt32
Returns
- IBitmapSource<TPixel>
Type Parameters
TPixel
CreateBitmapClipper<TPixel>(IImagingFactory, IBitmapSource<TPixel>, RectInt32, BitmapExtendMode)
Creates a clipped bitmap with a given extend mode. The clipping rect may extend outside of the source bounds.
public static IBitmapSource<TPixel> CreateBitmapClipper<TPixel>(this IImagingFactory factory, IBitmapSource<TPixel> source, RectInt32 sourceRect, BitmapExtendMode extendMode) where TPixel : unmanaged, INaturalPixelInfo
Parameters
factoryIImagingFactoryThe factory.
sourceIBitmapSource<TPixel>The bitmap source to clip.
sourceRectRectInt32A rectangle, in source coordinate space, that defines the size of the output bitmap. This rectangle may extend outside of the source bitmap's bounds (including negative coordinates). Pixels that are within the source bounds will be copied from the source, while pixels outside of the source bounds will be calculated based on the
extendModeparameter.extendModeBitmapExtendModeSpecifies how pixels outside of the source bitmap's bounds are calculated.
Returns
- IBitmapSource<TPixel>
The clipped bitmap.
Type Parameters
TPixel