DRAWAREA - dessinner des carres

Rédigé par spheris Aucun commentaire
Classé dans : Drawarea, gambas 2, Tutoriel, Widget Mots clés : aucun
DESSINER DES CARRES

qsdf.png
Voici une petite application pour dessiner des carrés dans une drawarea

TELECHARGER L'EXEMPLE ICI

voici le code de l'application :

' gambas class File
PUBLIC SUB _new()
END
PUBLIC SUB form_OPEN()
me.center
END
PUBLIC SUB button1_click()
DIM i AS Integer
DIM x AS Integer
DIM y AS Integer
draw.begin(da)
FOR i = 1 TO 200000
draw.fillcolor = int(rnd(&hffffff&))
draw.fillstyle = fill.solid
x = int(rnd(da.width))
y = int(rnd(da.height))
draw.rect(x - 7, y - 7, 7, 7)
NEXT
draw.END
END
PUBLIC SUB button2_click()
me.CLOSE
END