Capture Color From Point on Screen

J

Jody Gelowitz

I have seen some examples of how to capture a color from a point on screen
using C#, but haven't come across anything with VB.NET. Is this possible
under VB.NET? I know that I will need to use the GetPixel API in order to
do this.

Essentially, I would like to be able to move the mouse around the screen,
and wherever the left button is clicked, I would like to store the color
value of the point where the cursor is located. If possible, I would prefer
to stay in VB.NET

Any ideas?

Thanks,
Jody
 
B

Bob Powell [MVP]

Essentially this involves the same teqhnique as capturing the whole screen
or surface of a control.

A thread entitled "Making a ("screenshot") image of a single control" posted
a few days ago has the code for importing the BitBlt API and using it. In
this case you would possibly capture only one pixel unless you had a whole
lot to examine in which case you could capture as much of the screen as you
needed and use GetPixel on the resulting image.

--
Bob Powell [MVP]
C#, System.Drawing

Check out the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Buy quality Windows Forms tools
http://www.bobpowell.net/xray_tools.htm

New Tips and Tricks include creating transparent controls
and how to do double buffering.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top