| MIL 10 Reference
| Customize Help
| Save Settings

MgraDraw



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
Synopsis
Draw graphics, contained in a graphics list, in an image.
Syntax
void MgraDraw(
MIL_ID GraListId, //in
MIL_ID DestImageId, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws graphics, contained in the specified graphics list, destructively (raster-based) in the specified image.

A graphic's position and dimension values are interpreted with respect to the input coordinate system, specified using MgraControl() with M_INPUT_UNITS. Note that you can also use MgraControlList() with M_INPUT_UNITS to modify the input units of graphics that have already been added to the graphics list.

If you attempt to draw the graphics contained in the graphics list using world units, but without passing MgraDraw() a calibrated image, the function will generate an error.

If parts of the graphics fall outside of the specified image buffer area, those parts are clipped off.

If you are drawing graphics in a graphics list with interactive mode enabled (MdispControl() with M_GRAPHIC_LIST_INTERACTIVE set to M_ENABLE), selected graphics (graphics with M_GRAPHIC_SELECTED set to M_TRUE) are typically surrounded by annotations that indicate the graphic is selected, such as the selection box (represented by a dotted line) with handles that allow user interaction. By default, this function will draw the annotations that indicate the graphic is selected, unless otherwise specified.

Unlike most other functions that modify a MIL object, you can call this function concurrently from multiple threads on the same MIL graphics list (GraListId) without using an M_MUTEX object, as long as all the other parameters of the concurrent calls do not also share data.

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
GraListId

Specifies the identifier of the graphics list containing the graphics to destructively draw in the image. The graphics list must have been previously allocated on the required system using MgraAllocList().

DestImageId

Specifies the identifier of the destination image buffer in which to draw. If the graphics list contains graphics set in world units, a calibration context must be associated with the destination image buffer; otherwise, an error is generated.

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.

Note that you can also annotate an image non-destructively by drawing into its display's overlay buffer.

ControlFlag

Specifies whether to also draw the annotations that indicate whether a graphic is selected, such as the selection box and handles. This parameter must be set to one of the following values:

function map For specifying whether to draw annotations that indicate a graphic is selected
CollapseValue Description
Collapse M_DEFAULT

Specifies that annotations that indicate whether a graphic is selected will be drawn destructively in the image buffer, along with the graphic.

Collapse M_NO_INTERACTIVE_ANNOTATION

Specifies that annotations that indicate whether a graphic is selected will not be drawn in the image buffer, even if there are selected graphics in the graphics list.

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