Documentation / Marblecore Imaging / Methods / DrawFloodFill
DrawFloodFill method
Fills a region on the current image canvas with a specific color beginning on the specified position.
Syntax
Boolean DrawFloodFill(nLeft As Number, nTop As Number, nFillColor As Number, nFillOpacity As Number, bFillReplace As Boolean, nFill As Fill, nTolerance As Number, nStopColor As Number, bDiagonal As Boolean)
Return value
Returns true if the function succeeded.
Parameters
Parameter | Type | Required | Description |
nLeft | Number | Yes | Left coordinate of the begin point. |
nTop | Number | Yes | Top coordinate of the begin point. |
nFillColor | Number | Yes | Specifies the fill color. |
nFillOpacity | Number | No | Optional parameter containing the opacity percentage (where 0% is completely transparent) for the fill color. |
bFillReplace | Boolean | No | Optional parameter which specifies if the fill color needs to replace each pixel or to overlay the fill color over the pixel using the specified opacity. This parameter only has influence on the fill proces when a fill opacity less then 100% is specified. |
nFill | Fill (Enumeration) | No | Optional parameter which specifies the fill method. |
nTolerance | Number | No | Optional parameter which specifies the fill tolerance (only available if the fill-over method is used). |
nStopColor | Number | No | Optional parameter which specifies the stop color when using the fill-towards method. |
bDiagonal | Boolean | No | Optional parameter enabling or disabling 8-way floodfill. Disabled by default (4-way floodfill). |
Example
The example below shows the effect of this method and how to use it. You can slide the marker in the before/after picture to see the difference. If you take a look at the example code, assume there is a reference to the Marblecore Imaging object with the name 'MarblecoreImaging'. Transparent parts of the image are displayed using a checkerboard pattern.
1
2 MarblecoreImaging.Create(150, 150, true);
3
4
5 MarblecoreImaging.DrawFloodFill(75, 75, 16711680, 100, true, "Toward", 0, 0);
6
7
8 MarblecoreImaging.SaveToFile("example-drawfloodfill-after.jpg");
Category
Drawing
See also
DrawArc |
DrawArrow |
DrawBackground |
DrawBezier |
DrawCheckerboard |
DrawCurve |
DrawCurveBorder |
DrawCurveFilled |
DrawCurveGradient |
DrawEllipse |
DrawEllipseBorder |
DrawEllipseFilled |
DrawEllipseGradient |
DrawLine |
DrawPie |
DrawPieBorder |
DrawPieFilled |
DrawPieGradient |
DrawPixel |
DrawPolygon |
DrawPolygonBorder |
DrawPolygonFilled |
DrawPolygonGradient |
DrawRectangle |
DrawRectangleBorder |
DrawRectangleFilled |
DrawRectangleGradient |
DrawRectangleTransparent |
DrawRhombus |
DrawRhombusBorder |
DrawRhombusFilled |
DrawRhombusGradient |
DrawRoundRectangle |
DrawRoundRectangleBorder |
DrawRoundRectangleFilled |
DrawRoundRectangleGradient |
DrawTriangle |
DrawTriangleBorder |
DrawTriangleFilled |
DrawTriangleGradient |
GetPixelColor |
LineTo |
MoveTo