BitmapDataExtensionsCombine Method

The overloads of the Combine method can be grouped into the following categories:
  • The ones with one IReadableBitmapData source and an IReadWriteBitmapData target parameter combine the specified source and target bitmaps, and write the result back to the specified target. These overloads allow you to specify a Rectangle that represents the bounds in the source bitmap data and a Point that represents the location of the combined result in the target bitmap.
  • The other half of the methods have three bitmap data arguments: two IReadableBitmapData sources and one IWritableBitmapData target, allowing two bitmaps to be combined into a third target (it is allowed for them to be the same instances though). These overloads have three optional Point arguments to designate a custom origin in each bitmap, and one Size parameter to specify the bounds for all bitmaps.
  • As for the color depth, there are three method groups: you can use either Color32, Color64 or ColorF types in the combining function delegate. The overloads with the delegates using Color32 have also an optional ditherer parameter, which allows passing an IDitherer implementation when the combining function may return a wider set of colors than the target can represent (e.g. indexed bitmaps).
  • To be able to configure the degree of parallelism, cancellation or progress reporting, look for the overloads whose last parameter is a ParallelConfig instance.
  • Some overloads have an IAsyncContext parameter. These methods are special ones and are designed to be used from your custom asynchronous methods where combining colors is just one step of potentially multiple operations. But you can also use these overloads to force synchronous execution on a single thread. See the Examples section of the AsyncHelper class for details about how to create a context for possibly async top level methods.
  • All of these methods block the caller on the current thread. For asynchronous call you can use the CombineAsync overloads (on .NET Framework 4.0 and above), or the old-fashioned BeginCombine methods that work on every platform target.

Overload List

Combine(IReadableBitmapData, IReadWriteBitmapData, IAsyncContext, FuncColor64, Color64, Color64, NullableRectangle, NullablePoint) Combines the pixels of the source and target bitmaps using the specified combineFunction and a context that may belong to a higher level, possibly asynchronous operation, and writes the result into target.
Combine(IReadableBitmapData, IReadWriteBitmapData, IAsyncContext, FuncColorF, ColorF, ColorF, NullableRectangle, NullablePoint) Combines the pixels of the source and target bitmaps using the specified combineFunction and a context that may belong to a higher level, possibly asynchronous operation, and writes the result into target.
Combine(IReadableBitmapData, IReadWriteBitmapData, FuncColor64, Color64, Color64, NullableRectangle, NullablePoint, ParallelConfig) Combines the pixels of the source and target bitmaps using the specified combineFunction, and writes the result into target.
Combine(IReadableBitmapData, IReadWriteBitmapData, FuncColorF, ColorF, ColorF, NullableRectangle, NullablePoint, ParallelConfig) Combines the pixels of the source and target bitmaps using the specified combineFunction, and writes the result into target.
Combine(IReadableBitmapData, IReadWriteBitmapData, IAsyncContext, FuncColor32, Color32, Color32, NullableRectangle, NullablePoint, IDitherer) Combines the pixels of the source and target bitmaps using the specified combineFunction and a context that may belong to a higher level, possibly asynchronous operation, and writes the result into target.
Combine(IReadableBitmapData, IReadWriteBitmapData, FuncColor32, Color32, Color32, NullableRectangle, NullablePoint, IDitherer, ParallelConfig) Combines the pixels of the source and target bitmaps using the specified combineFunction, and writes the result into target.
Combine(IReadableBitmapData, IReadableBitmapData, IWritableBitmapData, IAsyncContext, FuncColor64, Color64, Color64, NullablePoint, NullablePoint, NullablePoint, NullableSize) Combines the pixels of source1 and source2 using the specified combineFunction and a context that may belong to a higher level, possibly asynchronous operation, and writes the result into target.
Combine(IReadableBitmapData, IReadableBitmapData, IWritableBitmapData, IAsyncContext, FuncColorF, ColorF, ColorF, NullablePoint, NullablePoint, NullablePoint, NullableSize) Combines the pixels of source1 and source2 using the specified combineFunction and a context that may belong to a higher level, possibly asynchronous operation, and writes the result into target.
Combine(IReadableBitmapData, IReadableBitmapData, IWritableBitmapData, FuncColor64, Color64, Color64, NullablePoint, NullablePoint, NullablePoint, NullableSize, ParallelConfig) Combines the pixels of source1 and source2 using the specified combineFunction, and writes the result into target.
Combine(IReadableBitmapData, IReadableBitmapData, IWritableBitmapData, FuncColorF, ColorF, ColorF, NullablePoint, NullablePoint, NullablePoint, NullableSize, ParallelConfig) Combines the pixels of source1 and source2 using the specified combineFunction, and writes the result into target.
Combine(IReadableBitmapData, IReadableBitmapData, IWritableBitmapData, IAsyncContext, FuncColor32, Color32, Color32, NullablePoint, NullablePoint, NullablePoint, NullableSize, IDitherer) Combines the pixels of source1 and source2 using the specified combineFunction and a context that may belong to a higher level, possibly asynchronous operation, and writes the result into target.
Combine(IReadableBitmapData, IReadableBitmapData, IWritableBitmapData, FuncColor32, Color32, Color32, NullablePoint, NullablePoint, NullablePoint, NullableSize, IDitherer, ParallelConfig) Combines the pixels of source1 and source2 using the specified combineFunction, and writes the result into target.

See Also