arvindb1
asked on
Read Pixel from Screen ( using VB.NET)
VB.NET Windows Application
If someone clicks on a pixel on a screen how can the pixel color be read e.g. in Mouse down event
Is it possible to access the screen as a bitmap? i.e. copy a specific area of the screen content into a bitmap.
Arvind
If someone clicks on a pixel on a screen how can the pixel color be read e.g. in Mouse down event
Is it possible to access the screen as a bitmap? i.e. copy a specific area of the screen content into a bitmap.
Arvind
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Get the color of a pixel from a picture box image:
Dim bm As Bitmap = Me.PictureBox1.Image
bm.GetPixel(x, y)
Dim bm As Bitmap = Me.PictureBox1.Image
bm.GetPixel(x, y)
Private Sub PictureBox1_MouseMove(ByVa l sender As Object, ByVal e As System.Windows.Forms.Mouse EventArgs) Handles PictureBox1.MouseMove
'get the picture box's bitmap into the "bitmap " variable
Dim bitmap As Bitmap = PictureBox1.Image
'get the color at the X,Y position, using the event (e) object
Dim color As Color = bitmap.GetPixel(e.X, e.Y)
'get the RGB value
Dim ColorValue As Integer = color.ToArgb
'extract the red, and set the form's caption
Me.Text = "Red = " & CStr((ColorValue And &HFF0000) \ &H10000) & _
" Green = " & CStr((ColorValue And &HFF0000) \ &H100) & _
" Blue = " & CStr((ColorValue And &HFF0000) \ &H1)
End Sub
'get the picture box's bitmap into the "bitmap " variable
Dim bitmap As Bitmap = PictureBox1.Image
'get the color at the X,Y position, using the event (e) object
Dim color As Color = bitmap.GetPixel(e.X, e.Y)
'get the RGB value
Dim ColorValue As Integer = color.ToArgb
'extract the red, and set the form's caption
Me.Text = "Red = " & CStr((ColorValue And &HFF0000) \ &H10000) & _
" Green = " & CStr((ColorValue And &HFF0000) \ &H100) & _
" Blue = " & CStr((ColorValue And &HFF0000) \ &H1)
End Sub
Is this still an open issue?
ASKER
Yes, Currently i'm analyzing proposed solutions, pls. give me some time. i'll definitely get back.
Thanks
Arvind
Thanks
Arvind
ASKER
Comment from testn has solved my problem
Thanks for help
Arvind
Thanks for help
Arvind
https://www.experts-exchange.com/questions/10047493/Capture-Screen-Image.html
D'Mzz!
RoverM