Tip
See the Examples section of the AsyncHelper
class for details about how to create a context for possibly async top level methods.
public static bool Combine(
this IReadableBitmapData source1,
IReadableBitmapData source2,
IWritableBitmapData target,
IAsyncContext? context,
Func<Color32, Color32, Color32> combineFunction,
Point? source1Location = null,
Point? source2Location = null,
Point? targetLocation = null,
Size? size = null,
IDitherer? ditherer = null
)<ExtensionAttribute>
Public Shared Function Combine (
source1 As IReadableBitmapData,
source2 As IReadableBitmapData,
target As IWritableBitmapData,
context As IAsyncContext,
combineFunction As Func(Of Color32, Color32, Color32),
Optional source1Location As Point? = Nothing,
Optional source2Location As Point? = Nothing,
Optional targetLocation As Point? = Nothing,
Optional size As Size? = Nothing,
Optional ditherer As IDitherer = Nothing
) As Booleanpublic:
[ExtensionAttribute]
static bool Combine(
IReadableBitmapData^ source1,
IReadableBitmapData^ source2,
IWritableBitmapData^ target,
IAsyncContext^ context,
Func<Color32, Color32, Color32>^ combineFunction,
Nullable<Point> source1Location = nullptr,
Nullable<Point> source2Location = nullptr,
Nullable<Point> targetLocation = nullptr,
Nullable<Size> size = nullptr,
IDitherer^ ditherer = nullptr
)[<ExtensionAttribute>]
static member Combine :
source1 : IReadableBitmapData *
source2 : IReadableBitmapData *
target : IWritableBitmapData *
context : IAsyncContext *
combineFunction : Func<Color32, Color32, Color32> *
?source1Location : Nullable<Point> *
?source2Location : Nullable<Point> *
?targetLocation : Nullable<Point> *
?size : Nullable<Size> *
?ditherer : IDitherer
(* Defaults:
let _source1Location = defaultArg source1Location null
let _source2Location = defaultArg source2Location null
let _targetLocation = defaultArg targetLocation null
let _size = defaultArg size null
let _ditherer = defaultArg ditherer null
*)
-> bool This method blocks the caller thread, but if context belongs to an async top level method, then the execution may already run on a pool thread. Degree of parallelism, the ability of cancellation and reporting progress depend on how these were configured at the top level method. To reconfigure the degree of parallelism of an existing context, you can use the AsyncContextWrapper class.
Alternatively, you can use this method to specify the degree of parallelism for synchronous execution. For example, by passing AsyncHelper.SingleThreadContext to the context parameter the method will be forced to use a single thread only.
When reporting progress, this library always passes a DrawingOperation instance to the generic methods of the IAsyncProgress interface.
The combined area is automatically clipped if size is larger than the dimensions of the smallest bitmap or the available sizes using the specified locations.
If target can represent a narrower set of colors, then the result will be automatically quantized to the colors of the target. To use dithering a ditherer must be explicitly specified. The ditherer is ignored for KnownPixelFormats with more than 16 bits-per-pixel and for grayscale formats.
| ArgumentNullException | source1,source2, target or combineFunction is . |