Operator Reference

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

dev_set_coloreddev_set_coloredDevSetColoredDevSetColoreddev_set_colored (Operator)

dev_set_coloreddev_set_coloredDevSetColoredDevSetColoreddev_set_colored — Set multiple output colors.

Signature

dev_set_colored( : : NumColors : )

Herror dev_set_colored(const Hlong NumColors)

Herror T_dev_set_colored(const Htuple NumColors)

void DevSetColored(const HTuple& NumColors)

static void HWindow::DevSetColored(Hlong NumColors)

static void HOperatorSet.DevSetColored(HTuple numColors)

static void HWindow.DevSetColored(int numColors)

def dev_set_colored(num_colors: int) -> None

Description

dev_set_coloreddev_set_coloredDevSetColoredDevSetColoreddev_set_colored allows to display tuples of regions, XLDs, and other geometrical objects in the graphics windows in different colors using a set of NumColorsNumColorsNumColorsnumColorsnum_colors predefined colors. Valid values for NumColorsNumColorsNumColorsnumColorsnum_colors can be queried with the operator query_coloredquery_coloredQueryColoredQueryColoredquery_colored.

For more information see the description of the operator set_coloredset_coloredSetColoredSetColoredset_colored. However, in contrast to that operator the color setting is also used for all new graphics windows that are opened afterwards.

These color settings remain valid until dev_set_colordev_set_colorDevSetColorDevSetColordev_set_color or dev_set_coloreddev_set_coloredDevSetColoredDevSetColoreddev_set_colored is called or until the color setting are modified interactively.

Attention

Using the code export feature of HDevelop, the code that is generated for this operator may have a different behavior than the related HALCON operator. For a detailed description of the code export of HDevelop graphics operators into the different programming languages see in the “HDevelop User's Guide” the chapter Code Export -> General Aspects of Code Generation -> Graphics Windows.

Parameters

NumColorsNumColorsNumColorsnumColorsnum_colors (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of output colors.

Default: 6

List of values: 3, 6, 12

Example (HDevelop)

read_image(Image,'monkey')
threshold(Image,Region,128,255)
dev_set_colored(6)
connection(Region,Regions)

Result

If the values of the specified parameters are correct, dev_set_coloreddev_set_coloredDevSetColoredDevSetColoreddev_set_colored returns 2 ( H_MSG_TRUE) . Otherwise, an exception is raised and an error code returned.

Possible Predecessors

dev_open_windowdev_open_windowDevOpenWindowDevOpenWindowdev_open_window

Possible Successors

dev_displaydev_displayDevDisplayDevDisplaydev_display

Alternatives

dev_set_colordev_set_colorDevSetColorDevSetColordev_set_color

See also

dev_set_drawdev_set_drawDevSetDrawDevSetDrawdev_set_draw, dev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidthdev_set_line_width, set_coloredset_coloredSetColoredSetColoredset_colored

Module

Foundation