Link to home
Start Free TrialLog in
Avatar of sofiaf
sofiaf

asked on

how to generate points

I  used visual basic before in excel to do calculations. I have now to use it to make pictures! I have to generate points (a regular pattern)  and I would like to know how to make a grid thing and then to put points inside (measures in pixels).
I also don't know if this will be the best way or if it would be better to use C or C++ or Fortran or S-Plus ...
hope this not to be asking too much.
Thanks
ASKER CERTIFIED SOLUTION
Avatar of pjknibbs
pjknibbs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This example shows how to set pixels of a picture box control to random colours. Just put a picture box and a command button on a form.

Private Sub Command1_Click()
    With Picture1
        For intRow = 0 To .Height Step 10
            For intCol = 0 To .Width Step 10
                Picture1.PSet (intCol, intRow), RGB(Int(Rnd() * 256), Int(Rnd() * 256), Int(Rnd() * 256))
            Next
        Next
    End With
End Sub