Herror ::query_color (
    const HTuple &WindowHandle,
    HTuple *Colors
)
HTuple HWindow::QueryColor (
    
) const

Query all color names displayable in the window.

::query_color returns the names of all colors that are usable for region output (::disp_region, ::disp_polygon, ::disp_circle, etc.). On a b/w screen ::query_color returns 'black' and 'white'. These two "colors" are displayable on any screen. In addition to 'black' and 'white' several grayvalues (e.g. 'dim gray') are returned on screens capable of grayvalues. 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 grayvalues. Before opening the first window it is furthermore possible to define the color list with ::set_system('graphic_colors',...). ::query_all_colors(WindowHandle,Colors ) returns a list of all available colors for the ::set_system('graphic_colors',...) call. For screens with truecolor output the same list is returned by ::query_color. 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_rgb or ::set_hsi. 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.


Parameters

WindowHandle (input_control)
window -> HTuple.long
Window_id.

Colors (output_control)
string-array -> HTuple.char *
Color names.


Example
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));

Result

::query_color returns H_MSG_TRUE, if the window is valid. Otherwise an exception handling is raised.


Possible Successors

::set_color, ::disp_region


See also

::query_all_colors, ::set_color, ::disp_region, ::open_window, ::open_textwindow


Module

System



Copyright © 1996-2002 MVTec Software GmbH