set_rgb — 通过 RGB 值设置颜色定义。
set_rgb( : : WindowHandle, Red, Green, Blue : )
set_rgb sets the output color(s) or the gray values, 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 operator, 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 operator call, multiple colors are used. The defined
colors are used until set_color,
set_rgb or set_gray is called again. The
values are used by operators like disp_region,
disp_line,
disp_rectangle1, disp_rectangle2,
disp_arrow, etc.
If a passed color is not available, an exception is raised.
If set_check(::'~color':) was called before,
HALCON uses a similar color and suppresses the error.
WindowHandle (输入控制) window → (handle)
窗口句柄。
Red (输入控制) integer(-array) → (integer)
Red component of the color.
默认值: 255
值范围:
0
≤
Red
≤
255
Green (输入控制) integer(-array) → (integer)
Green component of the color.
默认值: 0
值范围:
0
≤
Green
≤
255
Blue (输入控制) integer(-array) → (integer)
Blue component of the color.
默认值: 0
值范围:
0
≤
Blue
≤
255
set_rgb 返回 2 ( H_MSG_TRUE ) 表示窗口有效且所有传递的颜色均可用且可显示。否则将抛出异常。
基础