Get Pixel Color in VB.Net 2005 Picture Box

  • Thread starter Thread starter JasonRox
  • Start date Start date
  • Tags Tags
    Information Pixel
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
12 replies · 5K views
Messages
2,394
Reaction score
4
Hey!

Does anyone know how to get the "color" of a pixel in a picture box, in VB.Net 2005?

I want to encode things into an image, and then later pull the information out of the pixels.
 
Physics news on Phys.org
Greg Bernhardt said:
You can get the color of the pixel at position (x, y) by
calling the 'Bitmap' objects's 'GetPixel' method.

So, what is that? Like this?

Systems.Bitmap.GetPixel()
 
Greg Bernhardt said:
pf_bitmap = New System.Drawing.Bitmap
pf_bitmap.GetPixel(1, 1)

Thank you!

I'm going to try it out right now.

Oh yeah, what kind of information will it give me? That's another thing. :frown:
 
I have another question.

Now, what is the code to get the pixel that you clicked on?

So, you have a Picture Box.

If you click on it, how can I get the pixel location of where that click was?
 
NoTime said:
If you are in VB then you should have the "mousedown" callback for the picturebox.

I'll look into that.

My program will get better and better. :biggrin:
 
There is a highly specialized VB forum available here

http://www.vbforums.com/

I used it back when I did VB 6.0 developmnet, nowdays I am a Java man.