Learn how to draw with the following examples.

You must put a DrawingArea on your form to get these examples going.

You will find the DrawingArea in your Gambas Toolbox.

Example 1 Draw.Line

PUBLIC SUB Form_Open()
DIM B AS Integer 
Draw.Begin(DrawingArea1)
FOR B = 1 TO 200 STEP 10 
Draw.Line(1, B, 500, B)
NEXT 
Draw.End
END

Example 2: LineWidth

PUBLIC SUB Form_Open()
DIM B AS Integer 
Draw.Begin(DrawingArea1)
Draw.Line(10,100, 20, 100)
      FOR B = 1 TO 100 STEP 10 
       Draw.LineWidth=B 
       Draw.Line(10+B,100, 20+B, 100)
      NEXT 
Draw.End
END

Example 3 Random Points

PUBLIC SUB Form_Open()
DIM x AS Integer
DIM y AS Integer
DIM z AS Integer
Draw.Begin(DrawingArea1)
FOR z = 1 TO 10000
  x = Int(Rnd(0,200))
  y = Int(Rnd(0,200))
  Draw.Point(x,y)
NEXT 
Draw.End
END

-- ReinerHoffmann - 10 Jan 2004