| MIL 10 Reference
| Customize Help
| Save Settings

MgraCopy



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
Copy one or more graphics from one graphics list to another.
Syntax
void MgraCopy(
MIL_ID SrcListGraId, //in
MIL_ID DstListGraId, //in
MIL_INT64 Operation, //in
MIL_INT InsertLocation, //in
MIL_INT NumGraphics, //in
const MIL_INT *SrcIndexOrLabelArrayPtr, //in
MIL_INT *DstLabelArrayPtr, //out
MIL_INT64 ControlFlag //in
)
Description

This function copies or moves one or more graphics from a source graphics list to a destination graphics list. When moved, the graphics are erased from the source graphics list. You can specify the location in the destination graphics list at which to insert the copied graphics, which offers some control on the drawing order.

Note that if you want to replace all existing elements of the destination graphics list, you must clear it first using MgraClear().

This function supports in-place processing: the source and destination graphics list identifiers can refer to the same graphics list. In the case of an in-place move operation (M_MOVE), the graphic referred to by the InsertLocation parameter must not be one of the graphics being moved (SrcIndexOrLabelArrayPtr).

Unlike most other functions that modify a MIL object, you can call this function concurrently from multiple threads on the same MIL graphics list (DstListGraId) 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
SrcListGraId

Specifies the identifier of a valid graphics list from which to copy or move the graphics. You must have allocated the graphics list using MgraAllocList().

DstListGraId

Specifies the identifier of a valid graphics list in which to copy or move the graphics. You must have allocated the graphics list using MgraAllocList(). In-place processing is supported; DstListGraId can refer to the same graphics list as SrcListGraId.

Operation

Specifies the type of copy operation to perform. This parameter should be set to one of the following values:

function map For specifiying the type of copy operation to perform
CollapseValue Description
Collapse M_DEFAULT

Same as M_COPY + M_LABEL_VALUE.

Collapse M_COPY +

Specifies graphics from the source graphics list are copied to the destination graphics list. The graphics are not deleted from the source graphics list.

(summarize)
Collapse M_MOVE +

Specifies graphics from the source graphics list are moved to the destination graphics list. The graphics are deleted from the source graphics list.

(summarize)
Combination constants for the values listed in For specifiying the type of copy operation to perform.

You can add one of the following values to the above-mentioned values to specify whether indices or labels are given to the SrcIndexOrLabelArrayPtr parameter.

function map For specifying whether to use indices or labels
CollapseCombination value Description
Collapse M_INDEX_VALUE

Specifies index values are given to the SrcIndexOrLabelArrayPtr parameter.

Collapse M_LABEL_VALUE

Specifies labels are given to the SrcIndexOrLabelArrayPtr parameter.

This is the default value.

(summarize)
InsertLocation

Specifies the location inside the destination graphics list at which to insert the graphics. Note that the indices or labels passed to this parameter must refer to valid graphics. Otherwise, an error is generated.

function map For specifying the insert location in the destination graphics list
CollapseValue Description
Collapse M_DEFAULT

Same as M_END_OF_LIST.

Collapse

Specifies that the graphics will be inserted before the graphic with the specified index in the destination graphics list.

(summarize)
Parameters

Specifies the index. The index is from 0 (inclusive) to the total number of graphics in the list minus 1. If the given index value is not in that range, an error is generated. You can get the number graphics in the list using MgraInquireList() with M_NUMBER_OF_GRAPHICS. You can get the index corresponding to the label of a graphic using MgraInquireList() with M_INDEX_VALUE.

Collapse

Specifies that the graphics will be inserted before the graphic with the specified label in the destination graphics list.

(summarize)
Parameters

Specifies the label. The label must be greater than 0. If the label does not exist in the destination graphics list, an error is generated. You can get the label of the last graphic added to the list using MgraInquireList() with M_LAST_LABEL. You can get the label corresponding to the index of a graphic using MgraInquireList() with M_LABEL_VALUE.

Collapse M_END_OF_LIST

Specifies that the graphics are appended to the end of the destination graphics list.

NumGraphics

Specifies the number of graphics to copy or move.

function map For specifying the number of graphics to copy or move
CollapseValue Description
Collapse M_ALL

Specifies that all the graphics from the source graphics list must be copied or moved.

Collapse Value >= 0

Specifies the number of graphics from the source graphics list to be copied or moved.

SrcIndexOrLabelArrayPtr

Specifies the address of the array containing the indices or labels of the graphics to copy from the source graphics list. If the M_INDEX_VALUE combination constant is used with the Operation parameter, MIL expects the array to contain graphics indices. Otherwise, MIL expects it to contain graphics labels.

The array must contain at least NumGraphics indices or labels. If NumGraphics is set to M_ALL, you must set this parameter to M_NULL.

Note that the indices or labels passed to this parameter must refer to valid graphics. Otherwise, an error is generated.

DstLabelArrayPtr

Specifies the address of the array in which to write the labels that have been automatically given to the copied or moved graphics in the destination graphics list. The labels are written in the same order as the graphics are specified in the SrcIndexOrLabelArrayPtr parameter. If NumGraphics is set to M_ALL, the labels are written in index order.

The array must be at least as large as the number of graphics being moved or copied (NumGraphics). If NumGraphics is set to M_ALL, determine the required size of the array using MgraInquireList() with M_NUMBER_OF_GRAPHICS.

If you do not need the labels of the copied or moved graphics, this parameter can be set to M_NULL.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT COPY MOVE INDEX VALUE LABEL VALUE DEFAULT NUMBER OF GRAPHICS END OF LIST ALL