|
|
Title | Fill a large area one pixel at a time using PSet |
Keywords | graphics, PSet, pixel |
Categories | Graphics |
|
|
See my book Visual Basic Graphics Programming
for more information on graphics in Visual Basic.
The method
PSet(X, Y), color
sets the color of the pixel at (X, Y).
|
|
For Y = 0 To hgt - 1
For X = 0 To wid - 1
If (X \ 20) Mod 2 = (Y \ 20) Mod 2 Then
Picture1.PSet (X, Y), vbBlack
Else
Picture1.PSet (X, Y), clr
End If
Next X
Next Y
' Display the image.
Picture1.Picture = Picture1.Image
|
|
This program, together with the following programs, compares the speeds of different methods for manipulating an image's pixels one at a time.
|
|
|
|
|
|