BitmapDataExtensionsDrawIntoAsync(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode, TaskConfig) Method
Draws the
source IReadableBitmapData into the
target IReadWriteBitmapData asynchronously,
using scaling and blending. This method works between any pair of source and target
KnownPixelFormats and supports quantizing and dithering.
To copy a bitmap data into another one without blending use the
CopyToAsync methods,
or to use custom a function to specify how the source and target pixels should be combined, use the
CombineAsync methods instead.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
public static Task<bool> DrawIntoAsync(
this IReadableBitmapData source,
IReadWriteBitmapData target,
Rectangle sourceRectangle,
Rectangle targetRectangle,
IQuantizer? quantizer = null,
IDitherer? ditherer = null,
ScalingMode scalingMode = ScalingMode.Auto,
TaskConfig? asyncConfig = null
)
<ExtensionAttribute>
Public Shared Function DrawIntoAsync (
source As IReadableBitmapData,
target As IReadWriteBitmapData,
sourceRectangle As Rectangle,
targetRectangle As Rectangle,
Optional quantizer As IQuantizer = Nothing,
Optional ditherer As IDitherer = Nothing,
Optional scalingMode As ScalingMode = ScalingMode.Auto,
Optional asyncConfig As TaskConfig = Nothing
) As Task(Of Boolean)
public:
[ExtensionAttribute]
static Task<bool>^ DrawIntoAsync(
IReadableBitmapData^ source,
IReadWriteBitmapData^ target,
Rectangle sourceRectangle,
Rectangle targetRectangle,
IQuantizer^ quantizer = nullptr,
IDitherer^ ditherer = nullptr,
ScalingMode scalingMode = ScalingMode::Auto,
TaskConfig^ asyncConfig = nullptr
)
[<ExtensionAttribute>]
static member DrawIntoAsync :
source : IReadableBitmapData *
target : IReadWriteBitmapData *
sourceRectangle : Rectangle *
targetRectangle : Rectangle *
?quantizer : IQuantizer *
?ditherer : IDitherer *
?scalingMode : ScalingMode *
?asyncConfig : TaskConfig
(* Defaults:
let _quantizer = defaultArg quantizer null
let _ditherer = defaultArg ditherer null
let _scalingMode = defaultArg scalingMode ScalingMode.Auto
let _asyncConfig = defaultArg asyncConfig null
*)
-> Task<bool>
- source IReadableBitmapData
- The source IReadableBitmapData to be drawn into the target.
- target IReadWriteBitmapData
- The target IReadWriteBitmapData into which source should be drawn.
- sourceRectangle Rectangle
- A Rectangle that specifies the portion of the source to be drawn into the target.
- targetRectangle Rectangle
- A Rectangle that specifies the location and size of the drawn source.
- quantizer IQuantizer (Optional)
- An IQuantizer instance to be used for the drawing. If not specified, then the drawing operation might automatically
pick a quantizer based on target PixelFormat. This parameter is optional.
Default value: . - ditherer IDitherer (Optional)
- The ditherer to be used for the drawing. 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: . - scalingMode ScalingMode (Optional)
- Specifies the scaling mode if the bitmap data to be drawn needs to be resized. This parameter is optional.
Default value: Auto. - asyncConfig TaskConfig (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: .
TaskBooleanA task that represents the asynchronous operation. Its result is
, if the operation completed successfully,
or
, if the operation has been canceled and the
ThrowIfCanceled property in
asyncConfig parameter was
.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).
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.