set_rgb ( : : WindowHandle, Red, Green, Blue : )

Set the color definition via RGB values.

set_rgb sets the output color(s) or the grayvalues, respectively, for region output for the window. The colors are defined with the red, green and blue components. If only one combination is passed, all output takes place in that color. If a tuple is passed, region output and output of geometric objects takes place modulo the passed colors.

For every call of an output procedure, output is started with the first color. If only one object is displayed per call, it will always be displayed in the first color. This is even true for objects with multiple connection components. If multiple objects are displayed per procedure call, multiple colors are used. The defined colors are used until set_color, set_pixel, set_rgb or set_gray is called again. The values are used by procedures like disp_region, disp_line, disp_rectangle1, disp_rectangle2, disp_arrow, etc.


Attention

If a passed is not available, an exception handling is raised. If set_check(::'~color':) was called before, HALCON uses a similar color and suppresses the error.


Parameters

WindowHandle (input_control)
window -> integer
Window_id.

Red (input_control)
integer(-array) -> integer
Red component of the color.
Default value: 255
Typical range of values: 0 <= Red <= 255
Restriction: (0 <= Red) && (Red <= 255)

Green (input_control)
integer(-array) -> integer
Green component of the color.
Default value: 0
Typical range of values: 0 <= Green <= 255
Restriction: (0 <= Green) && (Green <= 255)

Blue (input_control)
integer(-array) -> integer
Blue component of the color.
Default value: 0
Typical range of values: 0 <= Blue <= 255
Restriction: (0 <= Blue) && (Blue <= 255)


Result

set_rgb returns 2 (H_MSG_TRUE) if the window is valid and all passed colors are available and displayable. Otherwise an exception handling is raised.


Parallelization Information

set_rgb is reentrant, local, and processed without parallelization.


Possible Successors

disp_image, disp_region


Alternatives

set_hsi, set_color, set_gray


See also

set_fix, disp_region


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH