| MIL 10 Reference
| Customize Help
| Save Settings

MgraFill



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Perform a boundary-type seed fill.
Syntax
void MgraFill(
MIL_ID ContextGraId, //in
MIL_ID DstImageBufId, //in
MIL_DOUBLE XStart, //in
MIL_DOUBLE YStart //in
)
Description

This function performs a boundary-type seed fill. It fills in an area of the specified image with the foreground color of the specified graphics context, starting from the seed position (XStart, YStart). Filling occurs on adjacent pixels (vertically and horizontally to original seed pixel) that have the same value as the original seed pixel.

If MgraFill() is used on a multi-band buffer, each band will be processed separately. This means that each band of the adjacent pixels will be compared with the corresponding band of the seed pixel. This can produce strange results if, for example, you try to fill the inside of a red circle with blue. The blue will spread to the whole image since the red circle does not exist in the blue band.

A seed's coordinates are interpreted with respect to the input coordinate system, specified using MgraControl() with M_INPUT_UNITS. Note that if you set your input coordinate system to M_WORLD and you pass MgraFill() an uncalibrated image, the function will generate an error.

Note that MgraFill() cannot be performed on graphics contained within a graphics list.

When compiling C code in 64-bit mode, MgraFill() internally calls the MIL_INT64 version of this function (MgraFillInt64()). If you need to pass floating-point values, call the MIL_DOUBLE version of this function (MgraFillDouble()).
Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextGraId

Specifies the identifier of the graphics context. This parameter must be set to one of the following values:

function map For specifying the graphics context
CollapseValue Description
Collapse M_DEFAULT

Specifies that the default graphics context of the current MIL application is used.

Note that there is a different default graphics context for each thread.

(summarize)
Collapse MIL graphics context identifier

Specifies a valid graphics context identifier, which you have allocated using MgraAlloc().

DstImageBufId

Specifies the identifier of a valid image buffer in which to perform the filling operation. You must have allocated the image buffer using MbufAlloc...().

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

XStart

Specifies the X-coordinate of the seed position in the input coordinate system. If the specified point is not within an enclosed area, filling occurs until the boundaries of the buffer are encountered.

YStart

Specifies the Y-coordinate of the seed position in the input coordinate system. If the specified point is not within an enclosed area, filling occurs until the boundaries of the buffer are encountered.

Type-specific versions of the function
void MgraFillDouble (MIL_ID ContextGraId, MIL_ID DstImageBufId, MIL_DOUBLE XStart, MIL_DOUBLE YStart)
Parameters

ContextGraId

See ContextGraId of the main function for a description.

DstImageBufId

See DstImageBufId of the main function for a description.

XStart

See XStart of the main function for a description.

YStart

See YStart of the main function for a description.

void MgraFillInt64 (MIL_ID ContextGraId, MIL_ID DstImageBufId, MIL_INT64 XStart, MIL_INT64 YStart)
Parameters

ContextGraId

See ContextGraId of the main function for a description.

DstImageBufId

See DstImageBufId of the main function for a description.

XStart

See XStart of the main function for a description.

YStart

See YStart of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT NONE