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 (算子名称)

名称

dev_set_coloreddev_set_coloredDevSetColoredDevSetColoreddev_set_colored — Set multiple output colors.

参数签名

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

描述

dev_set_coloreddev_set_coloredDevSetColoredDevSetColoredDevSetColoreddev_set_colored allows to display tuples of regions, XLDs, and other geometrical objects in the graphics windows in different colors using a set of NumColorsNumColorsNumColorsNumColorsnumColorsnum_colors predefined colors. Valid values for NumColorsNumColorsNumColorsNumColorsnumColorsnum_colors can be queried with 该算子 query_coloredquery_coloredQueryColoredQueryColoredQueryColoredquery_colored.

For more information see the description of 该算子 set_coloredset_coloredSetColoredSetColoredSetColoredset_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_colorDevSetColorDevSetColorDevSetColordev_set_color or dev_set_coloreddev_set_coloredDevSetColoredDevSetColoredDevSetColoreddev_set_colored is called or until the color setting are modified interactively.

注意

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.

参数表

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

Number of output colors.

Default: 6

List of values: 3, 6, 12

例程 (HDevelop)

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

结果

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

可能的前置算子

dev_open_windowdev_open_windowDevOpenWindowDevOpenWindowDevOpenWindowdev_open_window

可能的后置算子

dev_displaydev_displayDevDisplayDevDisplayDevDisplaydev_display

可替代算子

dev_set_colordev_set_colorDevSetColorDevSetColorDevSetColordev_set_color

参考其它

dev_set_drawdev_set_drawDevSetDrawDevSetDrawDevSetDrawdev_set_draw, dev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidthDevSetLineWidthdev_set_line_width, set_coloredset_coloredSetColoredSetColoredSetColoredset_colored

模块

Foundation