The following steps provide a basic methodology for using the MIL Graphics module to perform annotations:
Allocate a graphics context, using MgraAlloc() to store your drawing preference (for example, foreground and background color).
Allocate an image buffer, using MbufAlloc...(), or, allocate a graphics list, using MgraAllocList(), on which to perform the drawing operation.
If necessary, associate the graphics list with a display, using MdispControl() with M_ASSOCIATED_GRAPHIC_LIST_ID, to non-destructively annotate the image selected to the display.
If necessary, modify graphics context or graphics list settings, using MgraControl() or MgraControlList().
Draw graphics destructively in an image buffer or add graphics to the graphics list, using:
One of the functions provided in the MIL Graphics module, such as MgraArc() or MgraRect().
A draw function of a processing or analysis module (for example, MbeadDraw() or MmetDraw()).
MgraInteractive(), to interactively create and add graphics to the graphics list. A display must have the graphics list associated with it (MdispControl() with M_ASSOCIATED_GRAPHIC_LIST_ID) and the display must allow modification to graphics associated with it (MdispControl() with M_GRAPHIC_LIST_INTERACTIVE).
If necessary, annotate an image destructively with the graphics contained in the graphics list, using MgraDraw().
Free all your allocated objects using MgraFree().