BitmapDataExtensionsBeginCopyTo Method

Begins to copy the source IReadableBitmapData into the target IWritableBitmapData asynchronously, without scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. To draw a bitmap data into another one with blending use the BeginDrawInto methods instead.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
C#
public static IAsyncResult BeginCopyTo(
	this IReadableBitmapData source,
	IWritableBitmapData target,
	Rectangle? sourceRectangle = null,
	Point? targetLocation = null,
	IQuantizer? quantizer = null,
	IDitherer? ditherer = null,
	AsyncConfig? asyncConfig = null
)

Parameters

source  IReadableBitmapData
The source IReadableBitmapData to be copied into the target.
target  IWritableBitmapData
The target IWritableBitmapData into which source should be copied.
sourceRectangle  NullableRectangle  (Optional)
A Rectangle that specifies the portion of the source to be copied, or to copy the entire source. This parameter is optional.
Default value: .
targetLocation  NullablePoint  (Optional)
A Point that specifies the target location, or top copy the source to the top-left corner of the target. Target size will be always the same as the source size. This parameter is optional.
Default value: .
quantizer  IQuantizer  (Optional)
An IQuantizer instance to be used. If not specified, then the copying operation might automatically pick a quantizer based on target PixelFormat. This parameter is optional.
Default value: .
ditherer  IDitherer  (Optional)
The ditherer to be used. Might be ignored if quantizer is not specified and target PixelFormat format has at least 24 bits-per-pixel size. This parameter is optional.
Default value: .
asyncConfig  AsyncConfig  (Optional)
The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc. When Progress is set in this parameter, then this library always passes a DrawingOperation instance to the generic methods of the IAsyncProgress interface. This parameter is optional.
Default value: .

Return Value

IAsyncResult
An IAsyncResult that represents the asynchronous operation, which could still be pending.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadableBitmapData. 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).

Remarks

In .NET Framework 4.0 and above you can use also the CopyToAsync method.

To finish the operation and to get the exception that occurred during the operation you have to call the EndCopyTo method.

This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.

Exceptions

ArgumentNullExceptionsource or target is .

See Also