Table of Contents

Method CreateClipper

Namespace
PaintDotNet.Imaging
Assembly
PaintDotNet.Windows.Core.dll

CreateClipper(IBitmapSource, RectInt32)

public static IBitmapSource CreateClipper(this IBitmapSource source, RectInt32 rect)

Parameters

source IBitmapSource
rect RectInt32

Returns

IBitmapSource

CreateClipper<TPixel>(IBitmapSource<TPixel>, RectInt32)

public static IBitmapSource<TPixel> CreateClipper<TPixel>(this IBitmapSource<TPixel> source, RectInt32 rect) where TPixel : unmanaged, INaturalPixelInfo

Parameters

source IBitmapSource<TPixel>
rect RectInt32

Returns

IBitmapSource<TPixel>

Type Parameters

TPixel

CreateClipper<TPixel>(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> CreateClipper<TPixel>(this IBitmapSource<TPixel> source, RectInt32 sourceRect, BitmapExtendMode extendMode) where TPixel : unmanaged, INaturalPixelInfo

Parameters

source IBitmapSource<TPixel>

The bitmap source to clip.

sourceRect RectInt32

A 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 extendMode parameter.

extendMode BitmapExtendMode

Specifies how pixels outside of the source bitmap's bounds are calculated.

Returns

IBitmapSource<TPixel>

The clipped bitmap.

Type Parameters

TPixel