miércoles, 4 de noviembre de 2009

EJERCICIO CON EJEMLO ALEATORIOS

EJERCICIO UTILIZANDO EL DRAWING AREA DISEÑO:



CODIGO DEL EJERCICIO

PUBLIC x AS Integer
PUBLIC y AS Integer
PUBLIC r AS Integer
PUBLIC g AS Integer
PUBLIC b AS Integer

PUBLIC SUB Button1_Click()
Timer1.Enabled = TRUE
' Draw.Begin(area1)
' Draw.FillColor = Color.Red
'Draw.FillStyle = Fill.Solid
' Draw.Circle(200, 200, 80)
' Draw.Rect(80, 80, 80, 40)
' Draw.End
END

PUBLIC SUB Timer1_Timer()
x = Int(Rnd * 800)
y = Int(Rnd * 600)
r = Int(Rnd * 255)
g = Int(Rnd * 255)
b = Int(Rnd * 255)
Draw.Begin(area1)
Draw.FillColor = Color.Red
Draw.FillColor = Color.rgb(r, g, b)
Draw.FillStyle = Fill.Solid
Draw.Circle(x, y, 80)
Draw.Rect(100 + y, 100 + x, 100, 50)
Draw.End
END

PUBLIC SUB Button2_Click()
Timer2.Enabled = TRUE
' x = Int(Rnd * 800)
'y = Int(Rnd * 600)
' Draw.Begin(area1)
'Draw.FillColor = Color.Red
'Draw.FillStyle = Fill.Solid

' Draw.Ellipse(x, y, 80)
'Draw.Picture(100 + y, 100 + x, 100, 50)
'Draw.End
END

PUBLIC SUB Timer2_Timer()
x = Int(Rnd * 800)
y = Int(Rnd * 600)
Draw.Begin(area1)
Draw.FillColor = Color.Red
Draw.FillStyle = Fill.Solid
Draw.Circle(x, 20, 80)
'Draw.Picture(100 + y, 100 + x, 100, 50)
Draw.End
END

CODIGO

No hay comentarios:

Publicar un comentario