VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



nice grafix

by Daniel Quernheim (1 Submission)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

The code draws a nice texture in a PictureBox. I don't know what it could be used for, but perhaps you ... ;)

Assumes
it's easy: just make a new form with a picturebox (6000 x 3000 twips) and a button (cmdDraw) then copy this code.

Rate nice grafix

Private Sub cmdDraw_Click()
Dim r As Byte
Dim g As Byte
Dim b As Byte
Dim rI As Integer
Dim gI As Integer
Dim bI As Integer
Dim i As Integer
Dim ii As Integer
Randomize Timer
r = Int(Rnd * 2)
g = Int(Rnd * 4)
b = Int(Rnd * 6)
For i = 1 To 400 * 15 Step 15
 For ii = 1 To 200 * 15 Step 15
  Picture1.PSet (i, ii), RGB(r, g, b)
  rI = r + 1 + Int(Rnd * 3)
  If rI > 255 Then r = rI - 255 Else r = rI
  gI = g + 2 + Int(Rnd * 4)
  If gI > 255 Then g = gI - 255 Else g = gI
  bI = b + 3 + Int(Rnd * 5)
  If bI > 255 Then b = bI - 255 Else b = bI
 Next ii
Next i
End Sub

Download this snippet    Add to My Saved Code

nice grafix Comments

No comments have been posted about nice grafix. Why not be the first to post a comment about nice grafix.

Post your comment

Subject:
Message:
0/1000 characters