public static Task<bool> FillRectangleAsync(
this IReadWriteBitmapData bitmapData,
Color32 color,
RectangleF rectangle,
DrawingOptions? drawingOptions = null,
TaskConfig? asyncConfig = null
)
<ExtensionAttribute>
Public Shared Function FillRectangleAsync (
bitmapData As IReadWriteBitmapData,
color As Color32,
rectangle As RectangleF,
Optional drawingOptions As DrawingOptions = Nothing,
Optional asyncConfig As TaskConfig = Nothing
) As Task(Of Boolean)
public:
[ExtensionAttribute]
static Task<bool>^ FillRectangleAsync(
IReadWriteBitmapData^ bitmapData,
Color32 color,
RectangleF rectangle,
DrawingOptions^ drawingOptions = nullptr,
TaskConfig^ asyncConfig = nullptr
)
[<ExtensionAttribute>]
static member FillRectangleAsync :
bitmapData : IReadWriteBitmapData *
color : Color32 *
rectangle : RectangleF *
?drawingOptions : DrawingOptions *
?asyncConfig : TaskConfig
(* Defaults:
let _drawingOptions = defaultArg drawingOptions null
let _asyncConfig = defaultArg asyncConfig null
*)
-> Task<bool>
When filling a rectangle, the right/bottom values of the coordinates are exclusive, so if the width or height is zero, then nothing is drawn.
This method tries to use a shortcut to fill the rectangle directly, which is faster than creating a Path and adding the rectangle to it. A shortcut is possible when the location and size are integer values, and drawingOptions is and the specified color is opaque, or when drawingOptions specifies that no anti-aliasing and no alpha blending is required, the transformation is the identity matrix, and neither Quantizer nor Ditherer is specified.
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.
ArgumentNullException | bitmapData is . |
OverflowException | The coordinates (after a possible transformation specified in drawingOptions) are outside the bounds of an int value. |
TaskCanceledException | The operation has been canceled and the ThrowIfCanceled property in asyncConfig was . This exception is thrown when the result is awaited. |