| Customize Help
| Save Settings


Function Map
Allocate a 2D graphics list.
MIL_ID MgraAllocList(
MIL_ID SysId, //in
MIL_INT64 ListGraType, //in
MIL_ID *ListGraIdPtr //out

This function allocates a 2D graphics list, which holds graphics in vector (mathematical) form. Different 2D graphics lists can coexist; use their identifier to specify which to use or change. When a 2D graphics list is no longer required, you should release its memory, using MgraFree().

The 2D graphics list can be used to annotate the display non-destructively, using MdispControl() with M_ASSOCIATED_GRAPHIC_LIST_ID. Since graphics in a 2D graphics list are vector-based, you can zoom the display without the pixelation (loss of clarity) of the graphics. Also, if you add, modify, or delete graphics, the display can be immediately updated to reflect the changes. To set whether the display is automatically updated, use MdispControl() with M_UPDATE_GRAPHIC_LIST.

The 2D graphics list can also be used to draw destructively in an image, using MgraDraw(). Once drawn, the graphics are raster-based and are part of the image buffer; they cannot be modified. Also, if this annotated image is displayed, zooming it will cause pixelation (loss of clarity) of the graphics and changes in line thickness. Using MgraDraw() is similar to using a graphics function (for example, MgraArc()) to draw destructively in an image.

Graphics can be added to the list using any of the Mgra...() graphics functions, such as MgraArc(). To remove all graphics from the list, use MgraClear(). You can also use MgraControlList() with M_DELETE to remove graphics (one or all) from the list.

When you add graphics to the list, they inherit the current settings of the specified 2D graphics context (as described in MgraAlloc()); however, there is no link between the 2D graphics list and the 2D graphics context. Graphics already in the list are not affected by changes made to the context. To modify or inquire 2D graphics list settings, use MgraControlList() and MgraInquireList().

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 which MIL system’s documentation you should use in its place and any possible differences.
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.

Specifies the system on which to allocate the 2D graphics list.

This parameter should be set to one of the following values:

function map For specifying the system
Click to summarizeValue Description
Click to summarize M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Click to summarize MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().


Reserved for future expansion and must be set to M_DEFAULT.


Specifies the address of the variable in which to write the 2D graphics list identifier. Since the MgraAllocList() function also returns the 2D graphics list identifier, you can set this parameter to M_NULL.

Return value
The returned value is the 2D graphics list identifier if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.