MgraColor()函数

Synopsis

Sets the foreground color of a graphics context.

Format

void MgraColor(GraphContId, ForegroundColor)

MIL_ID GraphContId; Graphics context identifier
double ForegroundColor; Foreground drawing and text color

Description

This function sets the foreground color of a specified graphics context.

The GraphContId parameter specifies the identifier of the graphics context with which to associate the foreground color. This parameter can be set to M_DEFAULT, in which case the default graphics context of the current MIL application is used.

The ForegroundColor parameter specifies the foreground color. It can be a grayscale value or an RGB value.

A grayscale value can be any integer or floating-point number. If the given value exceeds the range of the possible values that can be stored in each band of the destination buffer, the least significant bits of the value are used.

To draw in true color in a color buffer (eg. 3-band RGB), you can use the macro:

M_RGB888(red component, green component, blue component)

See also

MgraBackColor, MgraAlloc, MgraInquire