| Customize Help
| Save Settings

MgraAlloc



Function Map
Synopsis
Allocate a 2D graphics context.
Syntax
MIL_ID MgraAlloc(
MIL_ID SysId, //in
MIL_ID *ContextGraIdPtr //out
)
Description

This function allocates a 2D graphics context on the specified system. A 2D graphics context is required to use MIL graphics to perform annotations. Whenever an annotation is done, 2D graphics context settings are inherited by the graphics. Different contexts can coexist; use their identifier to specify which to use or change. When a 2D graphics context is no longer required, you should release its memory, using MgraFree().

To modify or inquire 2D graphics context settings, use MgraControl() and MgraInquire().

Note that, upon allocation of an application, a default 2D graphics context is automatically allocated. Rather than using MgraAlloc() to allocate a 2D graphics context, you can use this default 2D graphics context, by specifying M_DEFAULT wherever a 2D graphics context identifier is required. Note that there is a different default 2D graphics context for each thread.

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.
Parameters
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.
Parameters
SysId INQ

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

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().

ContextGraIdPtr

Specifies the address of the variable in which the 2D graphics context identifier is to be written. Since MgraAlloc() also returns the buffer identifier, you can set this parameter to M_NULL. If allocation fails, M_NULL is written as the identifier.

Return value
The returned value is the 2D graphics context 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.
DEFAULT HOST