ClassesClassesClassesClasses | | | | Operators

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

dev_set_colordev_set_colorDevSetColordev_set_colorDevSetColorDevSetColor (Operator)

Name

dev_set_colordev_set_colorDevSetColordev_set_colorDevSetColorDevSetColor — Set one or more output colors.

Signature

dev_set_color( : : ColorName : )

Herror dev_set_color(const char* ColorName)

Herror T_dev_set_color(const Htuple ColorName)

Herror dev_set_color(const HTuple& ColorName)

void HWindow::DevSetColor(const HTuple& ColorName) const

void DevSetColor(const HTuple& ColorName)

static void HWindow::DevSetColor(const HTuple& ColorName)

static void HWindow::DevSetColor(const HString& ColorName)

static void HWindow::DevSetColor(const char* ColorName)

void HOperatorSetX.DevSetColor([in] VARIANT ColorName)

void HWindowX.DevSetColor([in] VARIANT ColorName)

static void HOperatorSet.DevSetColor(HTuple colorName)

static void HWindow.DevSetColor(HTuple colorName)

static void HWindow.DevSetColor(string colorName)

Description

dev_set_colordev_set_colorDevSetColordev_set_colorDevSetColorDevSetColor defines the color(s) that are used to display regions, XLDs, and other geometrical objects in the graphics windows. The available colors can be queried with the operator query_colorquery_colorQueryColorquery_colorQueryColorQueryColor. In addition, the ColorNameColorNameColorNameColorNameColorNamecolorName may be specified as an RGB triplet in the form '#rrggbb'"#rrggbb""#rrggbb""#rrggbb""#rrggbb""#rrggbb", where 'rr', 'gg', and 'bb' are hexadecimal numbers between '00' and 'ff', respectively.

For more information see the description of the operator set_colorset_colorSetColorset_colorSetColorSetColor. 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_colorDevSetColordev_set_colorDevSetColorDevSetColor or dev_set_coloreddev_set_coloredDevSetColoreddev_set_coloredDevSetColoredDevSetColored is called or until the color settings 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

ColorNameColorNameColorNameColorNameColorNamecolorName (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Output color names.

Default value: 'white' "white" "white" "white" "white" "white"

Suggested values: 'white'"white""white""white""white""white", 'black'"black""black""black""black""black", 'gray'"gray""gray""gray""gray""gray", 'red'"red""red""red""red""red", 'green'"green""green""green""green""green", 'blue'"blue""blue""blue""blue""blue", '#003075'"#003075""#003075""#003075""#003075""#003075", '#e53019'"#e53019""#e53019""#e53019""#e53019""#e53019", '#ffb529'"#ffb529""#ffb529""#ffb529""#ffb529""#ffb529"

Example (HDevelop)

read_image(Image,'mreut')
dev_set_draw('fill')
dev_set_color('red')
threshold(Image,Region,180,255)
dev_set_color('green')
threshold(Image,Region,0,179)

Result

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

Possible Predecessors

dev_open_windowdev_open_windowDevOpenWindowdev_open_windowDevOpenWindowDevOpenWindow, query_colorquery_colorQueryColorquery_colorQueryColorQueryColor, query_all_colorsquery_all_colorsQueryAllColorsquery_all_colorsQueryAllColorsQueryAllColors

Possible Successors

dev_displaydev_displayDevDisplaydev_displayDevDisplayDevDisplay

Alternatives

dev_set_coloreddev_set_coloredDevSetColoreddev_set_coloredDevSetColoredDevSetColored

See also

dev_set_drawdev_set_drawDevSetDrawdev_set_drawDevSetDrawDevSetDraw, dev_set_line_widthdev_set_line_widthDevSetLineWidthdev_set_line_widthDevSetLineWidthDevSetLineWidth, set_colorset_colorSetColorset_colorSetColorSetColor

Module

Foundation


ClassesClassesClassesClasses | | | | Operators