J
jason.cipriani
I am trying to get a pixel value from a picture box in VB 2005. I know
how to do it in VB 6:
clr& = Picture1.Point(x, y)
I can't figure out how to do it in 2005. Even the VB 6 import wizard
in VB 2005 can't seem to figure it out. The documentation says this:
"In Visual Basic 2005, the Point method no longer exists. You can use
the M:System.Drawing.Bitmap.GetPixel(System.Int32,System.Int32) method
to retrieve a color value from a bitmap."
And to that I say... "M:System.Drawing.Bitmap.GetPixel"? What? What is
that "M:", it appears to be invalid syntax? And System.Drawing.Bitmap
doesn't even seem to have a method named GetPixel... at least
according to auto-complete. And I see that that function takes two
Int32's, which I'm guessing are X and Y coordinates... but what does
that have to do with my picture box?
I noticed my PictureBox has an "Image" property, but that does not
have a GetPixel member either, and in general I'm unsure how any of
this is connected to "M:System.Drawing.Bitmap.GetPixel".
How do I do this? The documentation is frustrating... and VB 2005 in
general is giving me a lot of problems; it seems like everything I do
in VB 2005 requires double the amount of code it required in VB 6...
is this normal? I have had VB 2005 Express installed on my machine for
a while, and I keep meaning to learn it; but every time I need to put
something together with VB I end up using VB 6 since I already know
how to use it. Now I'm trying to just bite the bullet and do it, but
I'm having a ton of trouble making the transition. I can do everything
I want in VB 6, it's like it's directly connected to my brain, but
every time I start up VB 2005 I seem to end up fighting with it then
giving up.
Thanks,
Jason
how to do it in VB 6:
clr& = Picture1.Point(x, y)
I can't figure out how to do it in 2005. Even the VB 6 import wizard
in VB 2005 can't seem to figure it out. The documentation says this:
"In Visual Basic 2005, the Point method no longer exists. You can use
the M:System.Drawing.Bitmap.GetPixel(System.Int32,System.Int32) method
to retrieve a color value from a bitmap."
And to that I say... "M:System.Drawing.Bitmap.GetPixel"? What? What is
that "M:", it appears to be invalid syntax? And System.Drawing.Bitmap
doesn't even seem to have a method named GetPixel... at least
according to auto-complete. And I see that that function takes two
Int32's, which I'm guessing are X and Y coordinates... but what does
that have to do with my picture box?
I noticed my PictureBox has an "Image" property, but that does not
have a GetPixel member either, and in general I'm unsure how any of
this is connected to "M:System.Drawing.Bitmap.GetPixel".
How do I do this? The documentation is frustrating... and VB 2005 in
general is giving me a lot of problems; it seems like everything I do
in VB 2005 requires double the amount of code it required in VB 6...
is this normal? I have had VB 2005 Express installed on my machine for
a while, and I keep meaning to learn it; but every time I need to put
something together with VB I end up using VB 6 since I already know
how to use it. Now I'm trying to just bite the bullet and do it, but
I'm having a ton of trouble making the transition. I can do everything
I want in VB 6, it's like it's directly connected to my brain, but
every time I start up VB 2005 I seem to end up fighting with it then
giving up.
Thanks,
Jason