disp_textT_disp_textDispTextDispTextdisp_text (Operator)

Name

disp_textT_disp_textDispTextDispTextdisp_text — Ausgabe von Text in ein Fenster.

Signatur

disp_text( : : WindowHandle, String, CoordSystem, Row, Column, Color, GenParamName, GenParamValue : )

Herror T_disp_text(const Htuple WindowHandle, const Htuple String, const Htuple CoordSystem, const Htuple Row, const Htuple Column, const Htuple Color, const Htuple GenParamName, const Htuple GenParamValue)

void DispText(const HTuple& WindowHandle, const HTuple& String, const HTuple& CoordSystem, const HTuple& Row, const HTuple& Column, const HTuple& Color, const HTuple& GenParamName, const HTuple& GenParamValue)

void HWindow::DispText(const HTuple& String, const HString& CoordSystem, const HTuple& Row, const HTuple& Column, const HTuple& Color, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HWindow::DispText(const HString& String, const HString& CoordSystem, Hlong Row, Hlong Column, const HString& Color, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HWindow::DispText(const char* String, const char* CoordSystem, Hlong Row, Hlong Column, const char* Color, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HWindow::DispText(const wchar_t* String, const wchar_t* CoordSystem, Hlong Row, Hlong Column, const wchar_t* Color, const HTuple& GenParamName, const HTuple& GenParamValue) const   ( Nur Windows)

static void HOperatorSet.DispText(HTuple windowHandle, HTuple stringVal, HTuple coordSystem, HTuple row, HTuple column, HTuple color, HTuple genParamName, HTuple genParamValue)

void HWindow.DispText(HTuple stringVal, string coordSystem, HTuple row, HTuple column, HTuple color, HTuple genParamName, HTuple genParamValue)

void HWindow.DispText(string stringVal, string coordSystem, int row, int column, string color, HTuple genParamName, HTuple genParamValue)

def disp_text(window_handle: HHandle, string: MaybeSequence[str], coord_system: str, row: MaybeSequence[Union[int, float, str]], column: MaybeSequence[Union[int, float, str]], color: MaybeSequence[str], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, int, float]]) -> None

Beschreibung

disp_textdisp_textDispTextDispTextdisp_text gibt Text im Grafikfenster WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle an der Position (RowRowRowrowrow,ColumnColumnColumncolumncolumn) aus.

Wird nur eine Position übergeben, wird für jedes Element in StringStringStringstringValstring eine Textzeile ausgegeben. Außerdem wird auch '\n'"\n""\n""\n""\n" als Zeilenumbruch interpretiert.

Werden mehrere Positionen übergeben, ist nur ein einzelner String oder ein String für jede Position zulässig. In diesem Fall kann ein Zeilenumbruch nur über '\n'"\n""\n""\n""\n" erreicht werden.

Zeilenumbrüche ('\n'"\n""\n""\n""\n") am Ende von StringStringStringstringValstring werden ignoriert.

Die Position des Texts kann in Fensterkoordinaten (CoordSystemCoordSystemCoordSystemcoordSystemcoord_system = 'window'"window""window""window""window") oder in Bildkoordinaten (CoordSystemCoordSystemCoordSystemcoordSystemcoord_system = 'image'"image""image""image""image"), was für gezoomte Bilder nützlich ist, angegeben werden.

Zusätzlich zu (RowRowRowrowrow,ColumnColumnColumncolumncolumn) Koordinaten können auch vordefinierte Werte an RowRowRowrowrow und ColumnColumnColumncolumncolumn übergeben werden um Text an festen Positionen im Fenster anzuzeigen (nur für CoordSystemCoordSystemCoordSystemcoordSystemcoord_system = 'window'"window""window""window""window").:

'top'"top""top""top""top", 'left'"left""left""left""left" 'top'"top""top""top""top", 'center'"center""center""center""center" 'top'"top""top""top""top", 'right'"right""right""right""right"
'center'"center""center""center""center", 'left'"left""left""left""left" 'center'"center""center""center""center", 'center'"center""center""center""center" 'center'"center""center""center""center", 'right'"right""right""right""right"
'bottom'"bottom""bottom""bottom""bottom", 'left'"left""left""left""left" 'bottom'"bottom""bottom""bottom""bottom", 'center'"center""center""center""center" 'bottom'"bottom""bottom""bottom""bottom", 'right'"right""right""right""right"

Der Parameter ColorColorColorcolorcolor akzeptiert auch Farben-Tupel. In diesem Fall werden die Farben zyklisch für jede neue Textposition (oder für jede Textzeile wenn nur eine Position angegeben wurde) verwendet.

Generische Parameter

disp_textdisp_textDispTextDispTextdisp_text kann den StringStringStringstringValstring innerhalb einer Box anzeigen. Dieses Verhalten und das Aussehen der Box wird mit den generischen Parametern in GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name und GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value beeinflusst.

'box'

Ist 'box'"box""box""box""box" auf 'true'"true""true""true""true" gesetzt, wird der Text innerhalb einer Box angezeigt. Die folgenden Parameter beeinflussen das Aussehen dieser Box und des optionalen Schattens der Box.

Werteliste: 'true'"true""true""true""true" und 'false'"false""false""false""false"

Default: 'true'"true""true""true""true"

'box_color'

Setzt die Farbe der Box.

Werteliste: Ein String mit dem Namen der Farbe (z.B. 'white'"white""white""white""white", 'red'"red""red""red""red" oder '#aa00bba0'"#aa00bba0""#aa00bba0""#aa00bba0""#aa00bba0")

Default: '#fce9d4'"#fce9d4""#fce9d4""#fce9d4""#fce9d4" (ein helles Orange)

'shadow'

Wird 'shadow'"shadow""shadow""shadow""shadow" auf 'true'"true""true""true""true" gesetzt, wird zusätzlich ein Schatten zu der Box angezeigt.

Werteliste: 'true'"true""true""true""true" und 'false'"false""false""false""false"

Default: 'true'"true""true""true""true" wenn 'box_color'"box_color""box_color""box_color""box_color" auf eine Farbe ohne Alphawert gesetzt wurde, ansonsten 'false'"false""false""false""false"

'shadow_color'

Setzt die Farbe des Schattens.

Werteliste: Ein String mit dem Namen der Farbe (z.B. 'black'"black""black""black""black", 'red'"red""red""red""red" oder '#aa00bba0'"#aa00bba0""#aa00bba0""#aa00bba0""#aa00bba0")

Default: '#f28d26'"#f28d26""#f28d26""#f28d26""#f28d26" (ein dunkleres Orange) wenn 'box_color'"box_color""box_color""box_color""box_color" nicht gesetzt wurde, ansonsten 'white'"white""white""white""white"

'border_radius'

Setzt die Abrundung der Ecken der Box. Für scharfe Ecken muss dieser Parameter auf 0, für abgerundete Ecken auf höhere Werte gesetzt werden.

Werteliste: positive reelle Zahl oder 0

Default: 2

'box_padding'

Bestimmt, wie stark die Box über den Text hinaus geht.

Werteliste: positive reelle Zahl

Default: 0

'shadow_sigma'

Bestimmt, wie stark der Schatten hinter der Box weichgezeichnet wird. Für scharfe Schatten muss dieser Parameter auf 0 gesetzt werden.

Werteliste: positive reelle Zahl oder 0

Default: 1.5

'shadow_dx' und 'shadow_dy'

Der Offset des Schattens in Spalten- ('shadow_dx'"shadow_dx""shadow_dx""shadow_dx""shadow_dx") und Zeilenrichtung ('shadow_dy'"shadow_dy""shadow_dy""shadow_dy""shadow_dy") in Pixeln.

Werteliste: reelle Zahlen

Default: 2

'backdrop_blur_sigma'

Bestimmt, wie stark der Hintergrund der Box weichgezeichnet wird. Hat nur dann eine Auswirkung wenn 'box'"box""box""box""box" auf 'true'"true""true""true""true" gesetzt ist und 'box_color'"box_color""box_color""box_color""box_color" nicht opak ist (d.h. der Alpha-Anteil ist kleiner als 255). Es wird empfohlen, 'backdrop_blur_sigma'"backdrop_blur_sigma""backdrop_blur_sigma""backdrop_blur_sigma""backdrop_blur_sigma" mit 'shadow'"shadow""shadow""shadow""shadow" auf 'false'"false""false""false""false" gesetzt zu verwenden.

Werteliste: positive reelle Zahl oder 0

Default: 0

'rotate_phi'

Winkel in Grad um den der Text rotiert wird.

Werteliste: reelle Zahlen

Default: 0

'rotate_col'

Spaltenkoordinate des Rotationszentrums falls 'rotate_phi'"rotate_phi""rotate_phi""rotate_phi""rotate_phi" nicht Null ist. Entweder kann durch das Setzen einer reellen Zahl eine Spaltenkoordinate für das Rotationszentrum bestimmt werden, oder das Rotationszentrum wird an die linke Kante ('text_left'"text_left""text_left""text_left""text_left"), rechte Kante ('text_right'"text_right""text_right""text_right""text_right"), oder in das Zentrum ('text_center'"text_center""text_center""text_center""text_center") der Textbox gesetzt.

Werteliste: reelle Zahlen oder 'text_left'"text_left""text_left""text_left""text_left", 'text_center'"text_center""text_center""text_center""text_center", 'text_right'"text_right""text_right""text_right""text_right"

Default: 'text_center'"text_center""text_center""text_center""text_center"

'rotate_row'

Zeilenkoordinate des Rotationszentrums falls 'rotate_phi'"rotate_phi""rotate_phi""rotate_phi""rotate_phi" nicht Null ist. Entweder kann durch das Setzen einer reellen Zahl eine Zeilenkoordinate für das Rotationszentrum bestimmt werden, oder das Rotationszentrum wird an die obere Kante ('text_top'"text_top""text_top""text_top""text_top"), untere Kante ('text_bottom'"text_bottom""text_bottom""text_bottom""text_bottom"), oder in das Zentrum ('text_center'"text_center""text_center""text_center""text_center") der Textbox gesetzt.

Werteliste: reelle Zahlen oder 'text_top'"text_top""text_top""text_top""text_top", 'text_center'"text_center""text_center""text_center""text_center", 'text_bottom'"text_bottom""text_bottom""text_bottom""text_bottom"

Default: 'text_center'"text_center""text_center""text_center""text_center"

'border_color'

Bestimmt die Farbe des Randes um die Textbox.

Werteliste: Ein String mit dem Namen der Farbe (z.B. 'black'"black""black""black""black", 'red'"red""red""red""red" oder '#aa00bba0'"#aa00bba0""#aa00bba0""#aa00bba0""#aa00bba0")

Default: '#ffffff'"#ffffff""#ffffff""#ffffff""#ffffff"

'border_width'

Bestimmt die Breite des Randes um die Textbox.

Werteliste: positive reelle Zahl oder 0

Default: 0

Achtung

disp_textdisp_textDispTextDispTextdisp_text benötigt die Bibliothek libhcanvas, die auf Embedded-Systemen möglicherweise nicht verfügbar ist.

Ausführungsinformationen

Parameter

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

Fenster-Handle.

StringStringStringstringValstring (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Ein Tupel von Strings mit den anzuzeigenden Texten. Jeder String wird in einer Zeile ausgegeben.

Default: 'hello' "hello" "hello" "hello" "hello"

CoordSystemCoordSystemCoordSystemcoordSystemcoord_system (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Koordinatensystem für die Textposition. 'window' steht für das Fensterkoordinatensystem, 'image' für das Bildkoordinatensystem.

Default: 'window' "window" "window" "window" "window"

Werteliste: 'image'"image""image""image""image", 'window'"window""window""window""window"

RowRowRowrowrow (input_control)  point.y(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Vertikale Textausrichtung oder Zeilenkoordinate der Textposition.

Default: 12

Werteliste: 12, 'bottom'"bottom""bottom""bottom""bottom", 'center'"center""center""center""center", 'top'"top""top""top""top"

ColumnColumnColumncolumncolumn (input_control)  point.x(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Horizontale Textausrichtung oder Spaltenkoordinate der Textposition.

Default: 12

Werteliste: 12, 'center'"center""center""center""center", 'left'"left""left""left""left", 'right'"right""right""right""right"

ColorColorColorcolorcolor (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Ein Tupel von Strings für die Farben der Texte.

Default: 'black' "black" "black" "black" "black"

Werteliste: 'black'"black""black""black""black", 'blue'"blue""blue""blue""blue", 'coral'"coral""coral""coral""coral", 'cyan'"cyan""cyan""cyan""cyan", 'forest green'"forest green""forest green""forest green""forest green", 'green'"green""green""green""green", 'lime green'"lime green""lime green""lime green""lime green", 'magenta'"magenta""magenta""magenta""magenta", 'red'"red""red""red""red", 'slate blue'"slate blue""slate blue""slate blue""slate blue", 'yellow'"yellow""yellow""yellow""yellow"

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Namen der generischen Parameter.

Default: []

Werteliste: 'backdrop_blur_sigma'"backdrop_blur_sigma""backdrop_blur_sigma""backdrop_blur_sigma""backdrop_blur_sigma", 'border_color'"border_color""border_color""border_color""border_color", 'border_radius'"border_radius""border_radius""border_radius""border_radius", 'border_width'"border_width""border_width""border_width""border_width", 'box'"box""box""box""box", 'box_color'"box_color""box_color""box_color""box_color", 'box_padding'"box_padding""box_padding""box_padding""box_padding", 'rotate_col'"rotate_col""rotate_col""rotate_col""rotate_col", 'rotate_phi'"rotate_phi""rotate_phi""rotate_phi""rotate_phi", 'rotate_row'"rotate_row""rotate_row""rotate_row""rotate_row", 'shadow'"shadow""shadow""shadow""shadow", 'shadow_color'"shadow_color""shadow_color""shadow_color""shadow_color", 'shadow_dx'"shadow_dx""shadow_dx""shadow_dx""shadow_dx", 'shadow_dy'"shadow_dy""shadow_dy""shadow_dy""shadow_dy", 'shadow_sigma'"shadow_sigma""shadow_sigma""shadow_sigma""shadow_sigma"

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value-array HTupleSequence[Union[str, int, float]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Werte der generischen Parameter.

Default: []

Werteliste: 5.0, 'black'"black""black""black""black", 'blue'"blue""blue""blue""blue", 'false'"false""false""false""false", 'forest green'"forest green""forest green""forest green""forest green", 'red'"red""red""red""red", 'true'"true""true""true""true", 'white'"white""white""white""white"

Beispiel (HDevelop)

dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
disp_text (WindowHandle, 'Display some text in a box', 'window', 12, 12, \
           'black', [], [])

Vorgänger

open_windowopen_windowOpenWindowOpenWindowopen_window, set_fontset_fontSetFontSetFontset_font, get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsget_string_extents

Alternativen

write_stringwrite_stringWriteStringWriteStringwrite_string

Siehe auch

get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsget_string_extents, set_fontset_fontSetFontSetFontset_font

Modul

Foundation