By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,725 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,725 IT Pros & Developers. It's quick & easy.

Capture Color From Point on Screen

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

"Jody Gelowitz" <jg*******@visualstatement.com.nospam> wrote in message
news:eD**************@tk2msftngp13.phx.gbl...
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.