public static IAsyncResult BeginFillRectangle(
this IReadWriteBitmapData bitmapData,
Brush brush,
Rectangle rectangle,
DrawingOptions? drawingOptions = null,
AsyncConfig? asyncConfig = null
)<ExtensionAttribute>
Public Shared Function BeginFillRectangle (
bitmapData As IReadWriteBitmapData,
brush As Brush,
rectangle As Rectangle,
Optional drawingOptions As DrawingOptions = Nothing,
Optional asyncConfig As AsyncConfig = Nothing
) As IAsyncResultpublic:
[ExtensionAttribute]
static IAsyncResult^ BeginFillRectangle(
IReadWriteBitmapData^ bitmapData,
Brush^ brush,
Rectangle rectangle,
DrawingOptions^ drawingOptions = nullptr,
AsyncConfig^ asyncConfig = nullptr
)[<ExtensionAttribute>]
static member BeginFillRectangle :
bitmapData : IReadWriteBitmapData *
brush : Brush *
rectangle : Rectangle *
?drawingOptions : DrawingOptions *
?asyncConfig : AsyncConfig
(* Defaults:
let _drawingOptions = defaultArg drawingOptions null
let _asyncConfig = defaultArg asyncConfig null
*)
-> IAsyncResult 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 specified brush is a solid brush with an opaque color, and if drawingOptions is either , or it specifies that no anti-aliasing and no alpha blending is required, the transformation is the identity matrix, and neither Quantizer nor Ditherer is specified.
In .NET Framework 4.0 and above you can use also the FillRectangleAsync methods.
To finish the operation and to get the exception that occurred during the operation you have to call the EndFillRectangle method.
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.
| ArgumentNullException | bitmapData or brush is . |
| OverflowException | The coordinates (after a possible transformation specified in drawingOptions) are outside the bounds of an int value. |