BitmapDataExtensionsClip(IWritableBitmapData, Rectangle) Method

Clips the specified source using the specified clippingRegion. Unlike the Clone methods, this one returns a wrapper, providing access only to the specified region of the original source. This overload does not dispose source when the result is disposed.
See the Remarks section of the Clip(IWritableBitmapData, Rectangle, Boolean) overload for details.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.0.0-preview.3
C#
public static IWritableBitmapData Clip(
	this IWritableBitmapData source,
	Rectangle clippingRegion
)

Parameters

source  IWritableBitmapData
The source bitmap data to be clipped.
clippingRegion  Rectangle
A Rectangle that specifies a region within the source.

Return Value

IWritableBitmapData
An IWritableBitmapData that provides access only to the specified region withing the source.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IWritableBitmapData. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsource is .
ArgumentOutOfRangeExceptionclippingRegion has no overlapping region with source bounds.

See Also