BitmapDataExtensionsDrawIntoAsync(IReadableBitmapData, IReadWriteBitmapData, NullableRectangle, NullablePoint, IQuantizer, IDitherer, TaskConfig) Method
Draws the
source IReadableBitmapData into the
target IReadWriteBitmapData asynchronously,
without scaling, using blending. This method always preserves the source size in pixels, works between any pair of source and target
KnownPixelFormats and supports quantizing and dithering.
For scaling use the
DrawIntoAsync(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode, TaskConfig) overload.
To copy a bitmap data into another one without blending use the
CopyToAsync method instead.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.0.0-preview.1
public static Task DrawIntoAsync(
this IReadableBitmapData source,
IReadWriteBitmapData target,
Rectangle? sourceRectangle = null,
Point? targetLocation = null,
IQuantizer? quantizer = null,
IDitherer? ditherer = null,
TaskConfig? asyncConfig = null
)
<ExtensionAttribute>
Public Shared Function DrawIntoAsync (
source As IReadableBitmapData,
target As IReadWriteBitmapData,
Optional sourceRectangle As Rectangle? = Nothing,
Optional targetLocation As Point? = Nothing,
Optional quantizer As IQuantizer = Nothing,
Optional ditherer As IDitherer = Nothing,
Optional asyncConfig As TaskConfig = Nothing
) As Task
public:
[ExtensionAttribute]
static Task^ DrawIntoAsync(
IReadableBitmapData^ source,
IReadWriteBitmapData^ target,
Nullable<Rectangle> sourceRectangle = nullptr,
Nullable<Point> targetLocation = nullptr,
IQuantizer^ quantizer = nullptr,
IDitherer^ ditherer = nullptr,
TaskConfig^ asyncConfig = nullptr
)
[<ExtensionAttribute>]
static member DrawIntoAsync :
source : IReadableBitmapData *
target : IReadWriteBitmapData *
?sourceRectangle : Nullable<Rectangle> *
?targetLocation : Nullable<Point> *
?quantizer : IQuantizer *
?ditherer : IDitherer *
?asyncConfig : TaskConfig
(* Defaults:
let _sourceRectangle = defaultArg sourceRectangle null
let _targetLocation = defaultArg targetLocation null
let _quantizer = defaultArg quantizer null
let _ditherer = defaultArg ditherer null
let _asyncConfig = defaultArg asyncConfig null
*)
-> Task
- source IReadableBitmapData
- The source IReadableBitmapData to be drawn into the target.
- target IReadWriteBitmapData
- The target IReadWriteBitmapData into which source should be drawn.
- sourceRectangle NullableRectangle (Optional)
- A Rectangle that specifies the portion of the source to be drawn into the target, or to draw the entire source. This parameter is optional.
Default value: . - targetLocation NullablePoint (Optional)
- A Point that specifies the target location, or top draw 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 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: . - 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: .
TaskA
Task that represents the asynchronous operation, which could still be pending.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.