| Customize Help
| Save Settings

MgraDots



Function Map
Synopsis
Draw one or more dots in an image, or add them to a 2D graphics list.
Syntax
void MgraDots(
MIL_ID ContextGraId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT NumberOfDots, //in
const MIL_DOUBLE *PosXArrayPtr, //in
const MIL_DOUBLE *PosYArrayPtr, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws one or more dots destructively (raster-based) in the specified image. Alternatively, this function can add a vector-based version of the dots to the specified 2D graphics list, allowing you to, for example, non-destructively annotate a display without pixelation effects upon scaling.

Dots are based on the points positioned at PosXArrayPtr and PosYArrayPtr. The dots inherit all the relevant settings of the specified 2D graphics context, such as the foreground color (see MgraAlloc() for default context settings). If part of the dots fall outside of the specified area (image or display), that part is clipped off.

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

The coordinates of the dots are interpreted with respect to the input coordinate system, specified using MgraControl() or MgraControlList() with M_INPUT_UNITS. Note that if you set your input coordinate system to M_WORLD and you pass MgraDots() an uncalibrated image, the function will generate an error.

To create a single dot without the option of creating multiple dots, use MgraDot().

Note that prior to MIL 9.0, this function only supported integer positions; the PosXArrayPtr and PosYArrayPtr parameters only accepted arrays of type long. As of MIL 9.0, this function includes support for positions with floating-point precision. To implement this change and maintain backwards compatibility when using a C++ compiler (*.cpp), MgraDots() is available as an inline function which automatically calls MgraDotsDouble(), MgraDotsInt32(), and, MgraDotsInt64() depending on whether PosXArrayPtr and PosYArrayPtr receive arrays of type MIL_DOUBLE, MIL_INT32, or MIL_INT64, respectively. To maintain backwards compatibility when using a C compiler (*.c), MgraDots() maps to MgraDotsInt32() when working on a 32-bit system, or MgraDotsInt64() when working on a 64-bit system; you must explicitly call MgraDotsDouble() to pass PosXArrayPtr and PosYArrayPtr arrays of type MIL_DOUBLE. If you are an advanced user and want to retrieve a pointer to MgraDots(), you must use the Double, Int64, or Int32 version of this function, since MgraDots() is actually a macro or an overloaded function.

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

Note that when using a C compiler (not a C++ or other compiler), it is suggested to use the type-specific versions of this particular function, rather than the standard function prototype at the top of this page. An exhaustive list of type-specific versions of this function can be found at the bottom of this page.
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
ContextGraId

Specifies the identifier of the 2D graphics context. This parameter must be set to one of the following values:

function map For the identifier of the 2D graphics context
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies that the default 2D graphics context of the current MIL application is used.

Note that there is a different default 2D graphics context for each thread.

(summarize)
Click to summarize MIL 2D graphics context identifier

Specifies the identifier of the 2D graphics context, which you have allocated using MgraAlloc().

DstImageBufOrListGraId

Specifies the identifier of a valid image buffer in which to draw the dots or the identifier of a valid 2D graphics list in which to add the dots. You must have allocated the image buffer or the 2D graphics list using MbufAlloc...() or MgraAllocList(), respectively.

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.

NumberOfDots

Specifies the number of dots to draw.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the PosXArrayPtr or PosYArrayPtr parameter.

PosXArrayPtr INQ
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumberOfDots)

Specifies the address of the array containing the X-coordinate(s) of the dots to be drawn in the input coordinate system.

PosYArrayPtr INQ
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumberOfDots)

Specifies the address of the array containing the Y-coordinate(s) of the dots to be drawn in the input coordinate system.

ControlFlag

Reserved for future expansion. This parameter must be set to M_DEFAULT.

Type-specific versions of the function when using a C compiler
void MgraDotsDouble (MIL_ID ContextGraId, MIL_ID DstImageBufOrListGraId, MIL_INT NumberOfDots, const MIL_DOUBLE *PosXArrayPtr, const MIL_DOUBLE *PosYArrayPtr, MIL_INT64 ControlFlag)
Parameters

ContextGraId

See ContextGraId of the main function for a description.

DstImageBufOrListGraId

See DstImageBufOrListGraId of the main function for a description.

NumberOfDots

See NumberOfDots of the main function for a description.

PosXArrayPtr

See PosXArrayPtr of the main function for a description.

PosYArrayPtr

See PosYArrayPtr of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

void MgraDotsInt32 (MIL_ID ContextGraId, MIL_ID DstImageBufOrListGraId, MIL_INT NumberOfDots, const MIL_INT32 *PosXArrayPtr, const MIL_INT32 *PosYArrayPtr, MIL_INT64 ControlFlag)
Parameters

ContextGraId

See ContextGraId of the main function for a description.

DstImageBufOrListGraId

See DstImageBufOrListGraId of the main function for a description.

NumberOfDots

See NumberOfDots of the main function for a description.

PosXArrayPtr

See PosXArrayPtr of the main function for a description.

PosYArrayPtr

See PosYArrayPtr of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

void MgraDotsInt64 (MIL_ID ContextGraId, MIL_ID DstImageBufOrListGraId, MIL_INT NumberOfDots, const MIL_INT64 *PosXArrayPtr, const MIL_INT64 *PosYArrayPtr, MIL_INT64 ControlFlag)
Parameters

ContextGraId

See ContextGraId of the main function for a description.

DstImageBufOrListGraId

See DstImageBufOrListGraId of the main function for a description.

NumberOfDots

See NumberOfDots of the main function for a description.

PosXArrayPtr

See PosXArrayPtr of the main function for a description.

PosYArrayPtr

See PosYArrayPtr of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

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