Solved

Read Pixel from Screen ( using VB.NET)

Posted on 2003-12-09
8
3,049 Views
Last Modified: 2007-12-19
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

0
Comment
Question by:arvindb1
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 12

Expert Comment

by:roverm
ID: 9903018
0
 
LVL 18

Expert Comment

by:testn
ID: 9903442
0
 
LVL 18

Accepted Solution

by:
testn earned 500 total points
ID: 9903445
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9904825
Get the color of a pixel from a picture box image:

      Dim bm As Bitmap = Me.PictureBox1.Image
      bm.GetPixel(x, y)
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 28

Expert Comment

by:iboutchkine
ID: 9912538
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) 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
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9930625
Is this still an open issue?
0
 
LVL 5

Author Comment

by:arvindb1
ID: 9933326
Yes, Currently i'm analyzing proposed solutions, pls. give me some time. i'll definitely get back.
Thanks
Arvind
0
 
LVL 5

Author Comment

by:arvindb1
ID: 9933800
Comment from testn has solved my problem
Thanks for help
Arvind
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now