Home > Language Reference > Classes > Display

Rectangle Method

Draw a rectangle.

Syntax

Public Sub Rectangle(ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer, Optional ByVal eMode As HbRectangle = hbRectFillSolid+hbRectBorderSolid, Optional ByVal iRounded As Integer = 0)

ParameterDescription
x1X-coordinate of the top left corner of the rectangle.
y1Y-coordinate of the top left corner of the rectangle.
x2X-coordinate of the bottom right left corner of the rectangle.
y2Y-coordinate of the bottom right left corner of the rectangle.
eModeDrawing options.
iRoundedRadius of the circle used to draw the corners.

Remarks

The Rectangle method draws a rectangle specified by the (x1, y1), and (x2, y2) coordinates. The iRounded parameter indicates the radius of the circle used to draw the corners of the rectangle. This parameter should be less than or equal to 38, and less than half the height or width of the rectangle. Specify a null value for this parameter if you do not want rounded corners.

The eMode parameter specifies the drawing options, and should be a combination of the following group of constants:

To indicate the fill color, specify one of the following constants:

ConstantValueDescription
hbRectFillNone&H0000No fill.
hbRectFillSolid&H0001The drawing is filled with the current background color, previously specified by the BackColor property.
hbRectFillPattern&H0002The drawing is filled with the current pattern, previously specified by the Pattern property.

To indicate the border type, specify one of the following constants:

ConstantValueDescription
hbRectBorderNone&H0000No border.
hbRectBorderSolid&H0010The border is drawn with the foreground color, previously specified by the ForeColor property.

This method enqueues the drawing instruction in the graphics instruction buffer. The arc is only drawn when the buffer is emptied, either because it is full or because the Flush method is called.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A