Class «display»
Last updated
Last updated
This article is automatically translated from Russian by Google Translator.
Provides access to the display of the robot.
Screen size: 240*320 pixels.
Print the specified text on the screen, starting from the specified coordinate. If there was already text in the specified coordinates, it will be replaced by the new text.
The changes on the display will occur only after calling the method "redraw".
Parameters:
text
— display text,
x
, y
— screen coordinates.
Clear the drawing window.
Draw an arc of an ellipse inscribed into a rectangle with the upper left corner at specified coordinates and having a given width and height. The changes on the display will occur only after calling the method "redraw".
Parameters:
x
, y
— the coordinates of the upper left corner of the rectangle on the screen,
l
— rectangle width,
h
— rectangle height,
from
— initial angle bounding the arc,
to
— finite angle bounding the arc.
Draw an ellipse inscribed into a rectangle with the upper left corner at specified coordinates and having a given width and height. The changes on the display will occur only after calling the method "redraw".
Parameters:
x
, y
— coordinates of the upper left corner of the rectangle,
l
— rectangle width,
h
— rectangle height.
Draw a line with the beginning and the end at the given coordinates. The changes on the display will occur only after calling the method "redraw".
Parameters:
x0
, y0
— line origin coordinates,
x1
, y1
— line end coordinates.
Draw a point at given coordinates. The changes on the display will occur only after calling the method "redraw".
Parameters:
point coordinates x
, y
.
Draw a rectangle with the upper left corner at the specified coordinates and having the specified width and height. The changes on the display will occur only after calling the method "redraw".
Parameters:
x
, y
— coordinates of the upper left corner of the rectangle,
l
— rectangle width,
h
— rectangle height.
Close and clear the drawing window.
Redraw the window to draw. The changes to the display will only happen after this method is called.
Remove from the screen all text added to it by calls to the "addLabel" method.
Set the screen background to the color you specify.
Available colors:
white,
red, darkRed,
green, darkGreen,
blue, darkBlue,
cyan, darkCyan,
magenta, darkMagenta,
yellow, darkYellow,
gray, darkGray, lightGray,
black.
As a parameter, you must specify the color.
Set the color of the brush used to draw the graphical primitives.
Available colors:
white,
red, darkRed,
green, darkGreen,
blue, darkBlue,
cyan, darkCyan,
magenta, darkMagenta,
yellow, darkYellow,
gray, darkGray, lightGray,
black.
As a parameter, you must specify the color.
Set the thickness of the brush used to draw the graphical primitives, in pixels.
As a parameter, you must specify the thickness d
.
Display the image generated in the one-dimensional array on the controller.
Parameters:
array
— a one-dimensional integer array with dimensions width
×height
width
и height
— the width and height of the image, respectively
The format in which each element of the array is represented should be passed as the format parameter. The formats currently supported are: «rgb32», «grayscale8», «rgb888».
Examples of using show()
on an image taken withgetPhoto()
.
Display the image previously loaded on the robot.
The name of the image file (in BMP, GIF, JPG, JPEG, PNG, PBM, PGM, PPM, TIFF, XBM, XPM formats) must be specified as a parameter, the path is specified either as absolute or relative to the trik
folder.