query_colorT_query_colorQueryColorQueryColorquery_color (算子名称)

名称

query_colorT_query_colorQueryColorQueryColorquery_color — Query all color names displayable in the window.

参数签名

query_color( : : WindowHandle : Colors)

Herror T_query_color(const Htuple WindowHandle, Htuple* Colors)

void QueryColor(const HTuple& WindowHandle, HTuple* Colors)

HTuple HWindow::QueryColor() const

static void HOperatorSet.QueryColor(HTuple windowHandle, out HTuple colors)

HTuple HWindow.QueryColor()

def query_color(window_handle: HHandle) -> Sequence[str]

描述

query_colorquery_colorQueryColorQueryColorQueryColorquery_color returns the names of all colors that are usable for region output (disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region, disp_polygondisp_polygonDispPolygonDispPolygonDispPolygondisp_polygon, disp_circledisp_circleDispCircleDispCircleDispCircledisp_circle, etc.). On a b/w screen query_colorquery_colorQueryColorQueryColorQueryColorquery_color returns 'black'"black""black""black""black""black" and 'white'"white""white""white""white""white". These two “colors” are displayable on any screen. In addition to 'black'"black""black""black""black""black" and 'white'"white""white""white""white""white" several gray values (e.g., 'dim gray'"dim gray""dim gray""dim gray""dim gray""dim gray") are returned on screens capable of gray values. A list of all displayable colors is returned for screens with color lookup table. The returned tuple of colors begins with b/w, followed by the three primaries ('red'"red""red""red""red""red",'green'"green""green""green""green""green",'blue'"blue""blue""blue""blue""blue") and several gray values. query_all_colors(::WindowHandle:Colors )query_all_colors(WindowHandle,Colors )QueryAllColors(WindowHandle,Colors )QueryAllColors(WindowHandle,Colors )QueryAllColors(WindowHandle,Colors )query_all_colors(WindowHandle,Colors ) returns a list of all available colors. For screens with true-color output the same list is returned by query_colorquery_colorQueryColorQueryColorQueryColorquery_color. The list of available colors (to HALCON ) must not be confused with the list of displayable colors. For screens with true-color output the available colors are only a small subset of the displayable colors. Colors that are not directly available to HALCON can be chosen manually with set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb or set_hsiset_hsiSetHsiSetHsiSetHsiset_hsi. If colors are chosen that are known to HALCON but cannot be displayed, HALCON can choose a similar color. To use this feature, set_check(::'~color':)set_check("~color")SetCheck("~color")SetCheck("~color")SetCheck("~color")set_check("~color") must be set.

运行信息

参数表

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

ColorsColorsColorsColorscolorscolors (output_control)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Color names.

例程 (HDevelop)

open_window(0,0,-1,-1,'root','invisible','',WindowHandle)
query_color(WindowHandle,Colors)
close_window(WindowHandle)
fwrite_string (FileHandle, ['Displayable colors: ',Colors])

结果

query_colorquery_colorQueryColorQueryColorQueryColorquery_color returns 2 ( H_MSG_TRUE) , if the window is valid. Otherwise an exception is raised.

可能的后置算子

set_colorset_colorSetColorSetColorSetColorset_color, disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region

参考其它

query_all_colorsquery_all_colorsQueryAllColorsQueryAllColorsQueryAllColorsquery_all_colors, set_colorset_colorSetColorSetColorSetColorset_color, disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region, open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window

模块

Foundation