How do I make is to that I get to see randomly colored dots across the entire DrawingArea?
To make the dots standout, I'm using an expanded a 128x128 canvas.
This is my first foray into the DrawingArea object and there's very little documentation (that I could find) to help me trundle along so here I am.
' Gambas class file
Private xpos As Integer
Private ypos As Integer
Private red As Integer
Private green As Integer
Private blue As Integer
Private factor As Integer = 4
Public Sub DrawingArea1_Draw()
With Paint
.Brush = .Color(Color.RGB(red, green, blue, 0))
.LineWidth = 3.0
.MoveTo(xpos, ypos)
.LineTo(xpos + factor - 1, ypos)
.LineTo(xpos + factor - 1, ypos + factor - 1)
.Lineto(xpos, ypos + factor - 1)
.LineTo(xpos, ypos)
.Stroke
.End
End With
End
Public Sub btnDrawRandomlyColoredDots_Click()
Dim x, y As Integer
For x = 0 To 127
For y = 0 To 127
xpos = x * factor
ypos = y * factor
red = Rand(100, 255)
green = Rand(100, 255)
blue = Rand(100, 255)
DrawingArea1.Refresh
Next
DrawingArea1.Refresh
Next
DrawingArea1.Refresh
End
Public Sub Form_Open()
Randomize
End