Gambas/Graphics

Back to Gambas

If you want to produce some graphics in gambas you should get used to the drawingarea control.

Draw a Line
This little program will draw a line. You have to start a new graphics project. You take a form as your start form. You need a drawingarea and a commandbutton on the form to get it going.

When you want to draw some more lines, then try this example:

Some other lines are drawn here:

When you want to manipulate the width of your line, then try this example:

If you want to change the color of your line to white, then try this example:

The next small example will draw a box and fill it with white color.

The Spiral Program
This program shows you a nice spiral. There is no scale command in Gambas (at least, not yet). Therefore the x and y coordinates are transformed in the program. The coordinate system ranges from xmin = - 2 to xmax = 2 and ymin = - 2 to ymax = 2.

You need a Drawingarea and a Commandbutton to get the example going.

How does this look ? See

The code: