I'm working on a simple project and it has been years since I set up vb to use the graphics library any help would be appreciated. I just want to plot some pixels in a picture box.
Printable View
I'm working on a simple project and it has been years since I set up vb to use the graphics library any help would be appreciated. I just want to plot some pixels in a picture box.
Hi The Cubist, welcome to VBForums! :wave:
You can do this using PSet, eg:
Note that you will probably want to set the ScaleMode of the PictureBox to Pixel.VB Code:
Picture1.PSet (10, 20), vbRed
That will work just fine thanks alot :)
You can also use SetPixel, which is a bit more efficient.
VB Code:
Declare Function SetPixel(ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long ' usage: SetPixel Picture1.hDC, 10, 20, vbRed