Shiny Language Reference

Language Reference > Drawing Functions


fillrect

fillrect(int X, int Y, int Width, int Height, int RGBColour);

 

Synonyms:

fillsolidrect(int X, int Y, int Width, int Height, int RGBColour);

 

 

Draws a filled rectangle in the display panel

DRAWRECT draws a filled rectangle in the display panel using the specified RGB colour.

This statement is only valid in the Render handler.

 

Parameters

X

The X position of the top left of the rectangle. 0 is the top left corner of the display panel.

Y

The Y position of the top left of the rectangle. 0 is the top left corner of the display panel.

Width

The width of the rectangle in pixels.

Height

The height of the rectangle in pixels.

RGBColour

The RGB colour to use for the rectangle, supplied as an integer. To create this value from RGB components, use the RGB statement.

Return Value

None

 

Example Code

// Draw a 25*25 white rectangle at 10, 10
fillrect(10, 10, 25, 25, RGB(255, 255, 255));