Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Capture Color From Point on Screen

1 view
Skip to first unread message

Jody Gelowitz

unread,
Aug 6, 2003, 1:46:01 AM8/6/03
to
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


Bob Powell [MVP]

unread,
Aug 6, 2003, 4:19:21 AM8/6/03
to
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" <jgel...@visualstatement.com.nospam> wrote in message
news:eDnvG49W...@tk2msftngp13.phx.gbl...

0 new messages