VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This will randomly change single pixel's color in a form! Awsome for a backround or screensaver!!

by VisualScope (20 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 7th July 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This will randomly change single pixel's color in a form! Awsome for a backround or screensaver!!

Rate This will randomly change single pixel's color in a form! Awsome for a backround or screensaver!!



Dim red As Integer 'declare all varibles
Dim blue As Integer
Dim green As Integer
Dim randomx As Integer
Dim randomy As Integer
Dim x As Integer
Do Until x = 999 ' change the 999 to whatever you want to slow down or speed up the pixel change
x = x + 1
red = 255 * Rnd 'randomize red color
blue = 255 * Rnd 'randomize blue color
green = 255 * Rnd 'randomize green color
randomx = Rnd * ScaleWidth 'randomize x value
randomy = Rnd * ScaleWidth 'randomize y value
PSet (randomx, randomy), RGB(red, green, blue) 'set pixel color at (randomx, randomy) to RGB(red, green, blue)
Loop
End Sub


Private Sub Timer1_Timer()
'Form1.BackColor = &H0& 'these things look awsome if you want to use them.....
'Form1.WindowState = 2
Call PixelSet
End Sub

Download this snippet    Add to My Saved Code

This will randomly change single pixel's color in a form! Awsome for a backround or screensaver!! Comments

No comments have been posted about This will randomly change single pixel's color in a form! Awsome for a backround or screensaver!!. Why not be the first to post a comment about This will randomly change single pixel's color in a form! Awsome for a backround or screensaver!!.

Post your comment

Subject:
Message:
0/1000 characters