HALCON Reference Manual 10.0.2
Table of Contents / Graphics / Parameters ClassesClassesClasses | | | Operators

query_colorT_query_colorquery_colorQueryColorQueryColor (Operator)

Name

query_colorT_query_colorquery_colorQueryColorQueryColor — Query all color names displayable in the window.

Signature

query_color( : : WindowHandle : Colors)

Herror T_query_color(const Htuple WindowHandle, Htuple* Colors)

Herror query_color(const HTuple& WindowHandle, HTuple* Colors)

HTuple HWindow::QueryColor() const

void HOperatorSetX.QueryColor(
[in] VARIANT WindowHandle, [out] VARIANT* Colors)

VARIANT HWindowX.QueryColor()

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

HTuple HWindow.QueryColor()

Description

query_colorquery_colorquery_colorQueryColorQueryColor returns the names of all colors that are usable for region output (disp_regiondisp_regiondisp_regionDispRegionDispRegion, disp_polygondisp_polygondisp_polygonDispPolygonDispPolygon, disp_circledisp_circledisp_circleDispCircleDispCircle, etc.). On a b/w screen query_colorquery_colorquery_colorQueryColorQueryColor returns 'black' and 'white'. These two “colors” are displayable on any screen. In addition to 'black' and 'white' several gray values (e.g. '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','green','blue') and several gray values. Before opening the first window it is furthermore possible to define the color list with set_system(::'graphic_colors',...:)set_system("graphic_colors",...)set_system("graphic_colors",...)SetSystem("graphic_colors",...)SetSystem("graphic_colors",...). query_all_colors(::WindowHandle:Colors )query_all_colors(WindowHandle,Colors )query_all_colors(WindowHandle,Colors )QueryAllColors(WindowHandle,Colors )QueryAllColors(WindowHandle,Colors ) returns a list of all available colors for the set_system(::'graphic_colors',...:)set_system("graphic_colors",...)set_system("graphic_colors",...)SetSystem("graphic_colors",...)SetSystem("graphic_colors",...) call. For screens with truecolor output the same list is returned by query_colorquery_colorquery_colorQueryColorQueryColor. The list of available colors (to HALCON ) must not be confused with the list of displayable colors. For screens with truecolor 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_rgbset_rgbSetRgbSetRgb or set_hsiset_hsiset_hsiSetHsiSetHsi. If colors are chosen that are known to HALCON but cannot be displayed, HALCON can choose a similar color. To use this faeture, set_check(::'~color':) must be set.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Window_id.

ColorsColorsColorsColorscolors (output_control)  string-array HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Color names.

Example (HDevelop)

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

Example (C)

Htuple  Colors, WindowHandleTuple ;
open_window(0,0,-1,-1,0,"invisible","",&WindowHandle);
create_tuple(&WindowHandleTuple,1) ;
set_i(WindowHandleTuple, WindowHandle, 0) ;
T_query_color(WindowHandleTuple,&Colors);
close_window(WindowHandle);
for (i=0; i<length_tuple(Colors); i++)
  printf("Farbe #%s = %s\n",i,get_s(Colors,i));

Example (HDevelop)

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

Example (HDevelop)

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

Example (HDevelop)

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

Result

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

Possible Successors

set_colorset_colorset_colorSetColorSetColor, disp_regiondisp_regiondisp_regionDispRegionDispRegion

See also

query_all_colorsquery_all_colorsquery_all_colorsQueryAllColorsQueryAllColors, set_colorset_colorset_colorSetColorSetColor, disp_regiondisp_regiondisp_regionDispRegionDispRegion, open_windowopen_windowopen_windowOpenWindowOpenWindow, open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow

Module

Foundation


Table of Contents / Graphics / Parameters ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH