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 IReadWriteBitmapData? Clone(
this IReadableBitmapData source,
IAsyncContext? context,
KnownPixelFormat pixelFormat,
IQuantizer? quantizer,
IDitherer? ditherer = null,
Rectangle? sourceRectangle = null
)
<ExtensionAttribute>
Public Shared Function Clone (
source As IReadableBitmapData,
context As IAsyncContext,
pixelFormat As KnownPixelFormat,
quantizer As IQuantizer,
Optional ditherer As IDitherer = Nothing,
Optional sourceRectangle As Rectangle? = Nothing
) As IReadWriteBitmapData
public:
[ExtensionAttribute]
static IReadWriteBitmapData^ Clone(
IReadableBitmapData^ source,
IAsyncContext^ context,
KnownPixelFormat pixelFormat,
IQuantizer^ quantizer,
IDitherer^ ditherer = nullptr,
Nullable<Rectangle> sourceRectangle = nullptr
)
[<ExtensionAttribute>]
static member Clone :
source : IReadableBitmapData *
context : IAsyncContext *
pixelFormat : KnownPixelFormat *
quantizer : IQuantizer *
?ditherer : IDitherer *
?sourceRectangle : Nullable<Rectangle>
(* Defaults:
let _ditherer = defaultArg ditherer null
let _sourceRectangle = defaultArg sourceRectangle null
*)
-> IReadWriteBitmapData
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.
When reporting progress, this library always passes a DrawingOperation instance to the generic methods of the IAsyncProgress interface.
ArgumentNullException | source is . |
ArgumentOutOfRangeException | pixelFormat does not specify a valid format.
-or- sourceRectangle has no overlapping region with source bounds. |
ArgumentException | quantizer uses a palette with too many colors for the specified pixelFormat. |