Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27230

[RESOLVED] Simply set pixel at position 0,0 to red, what's going wrong?

$
0
0
I am simply trying to set the pixel at 0,0 to the color red.
Code:

Dim newPic As System.Drawing.Bitmap
newPic.SetPixel(0, 0, Color.Red)

Afterwards, I want this to display on a picturebox.
Code:

Picturebox1.Image = newPic
Error showing up:
Code:

Object reference not set to an instance of an object.
So obviously I'm doing it wrong. How do I set pixel 0,0 to red?

Viewing all articles
Browse latest Browse all 27230

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>