Drawing Rectangles

From Progzoo

The method Graphics method drawRect(x,y,width,height) can be used to draw draw a rectangle with the current line style and colour. The top left corner is specified by (x,y) the width and height are as specified.

A Drawn Rectangle
A Drawn Rectangle


[Font] [Default] [Show] [Resize] [History] [Profile]

Fill Rectangle

A Filled Rectangle
A Filled Rectangle


[Font] [Default] [Show] [Resize] [History] [Profile]

Rounded Rectangle

The methods drawRoundRect(x,y,width,height,rx,ry) draws a rectangle with rounded corners.

  • x,y Top left corner of the rectangle
  • width, height the width and height of the rectangle
  • rx, ry The radius of the corners in the x and y directions
A Rectangle with Rounded Corners
A Rectangle with Rounded Corners


[Font] [Default] [Show] [Resize] [History] [Profile]