PDA

Click to See Complete Forum and Search --> : Slow


TB
Feb 11th, 2001, 10:45 AM
I trie to fill out a PictueBox control (for example blue) with the Pset function, it takes days.
Can I improve the speed of that?

That is the code:

For x = 0 to PictureBox.Width-1
For y = 0 to PictureBox.Height-1
Pset (x,y) , 0
Next y
Next x

HarryW
Feb 11th, 2001, 11:06 AM
Use BitBlt. BitBlt has been explained millions of times on this forum already so I can't be botherd to type it all out again :) Go look for threads on BitBlt, it's easy enough to use.

Fox
Feb 11th, 2001, 12:11 PM
Yep. Also there's some BitBlt samples on my website ;)

...and especially in your case (to fill a picturebox) you can use the following code:


'Fills Picture1 with blue pixels :D
Picture1.BackColor = RGB( 0, 0, 255 )