Jump to content

Determine pixel color


Recommended Posts

QUOTE(Joost van Hamond @ Feb 27 2007, 09:14 PM)

My problem: I would like to know the pixel color of for example an internetpage. So, LabVIEW will run on 'the background' and will look for a specific pixel and determines it's collor. I'm using LabVIEW 7.0

This one sounds like fun: can you give us an example webpage? Is the pixel always in an image in that webpage? Is it always in the same place? Can you show us wat you've already tried?

Link to comment

If you want to get the color of any pixel on the screen, you can probably use some Windows API functions to get the image of what appears on the screen.

If you want the ugly way, you can simulate a PrintScreen click using the API functions (there are some VIs floating around to do this) and then use the Application class GetClipboardImage method (a private method in 7.x, so you need to enable scripting).

Link to comment

QUOTE(yen @ Feb 27 2007, 07:21 PM)

If you want to get the color of any pixel on the screen, you can probably use some Windows API functions to get the image of what appears on the screen.

If you want the ugly way, you can simulate a PrintScreen click using the API functions (there are some VIs floating around to do this) and then use the Application class GetClipboardImage method (a private method in 7.x, so you need to enable scripting).

Thanks, I'll have try...

Answerering your questions Crelf: All kind of webpages are examples, it's not for a specific webpage. The pixel I would like to check can be all over the page, so it is posible that it will be an image, but it could be text as well. I would like to check different 'pixel places', but I don't think that will be a problem. And finally: I didn't try anything so far, because I really have no idea how to deal with this....!

Thanks for your help so far...

Joost

Link to comment

QUOTE(Joost van Hamond @ Feb 27 2007, 03:55 PM)

Answerering your questions Crelf: All kind of webpages are examples, it's not for a specific webpage. The pixel I would like to check can be all over the page, so it is posible that it will be an image, but it could be text as well. I would like to check different 'pixel places', but I don't think that will be a problem. And finally: I didn't try anything so far, because I really have no idea how to deal with this....!

Joost,

Just a thought I had that you'll probably need to watch out for... Depending on how (which browser) you render the webpage in, you'll probably get different results. There's many differences between the way Internet Explorer, Firefox, Opera, etc. renders pages (especially once you get into style sheets and such) that could throw off your application and give you different results. Also, if you're planning to distribute this application, most browsers allow the user to override color settings (like background and text colors) for handicapped users.

Just something to think about...

Link to comment

QUOTE(Joost van Hamond @ Feb 27 2007, 12:14 PM)

When I read your question I went ahead and made the attached llb (LV 8.0) just for the fun of it.

It implements the screen capture the ugly clipboard way, but seems to work.

The 'App.Get Image' part was made by yen, and taken from this thread:

http://forums.lavag.org/index.php?showtopic=4281

If you want to check for specific data on a web page, it might be more productive and a lot more elegant to retrieve the HTML for the page, and then parse this string. 'Data socket read' can be used for this purpose, if you provide the URL as 'connection in' (if you don't want to implement the HTML transfer yourself using the TCPIP primitives).

-Mikkel :)

http://forums.lavag.org/index.php?act=attach&type=post&id=5058

Edit: Dooh! Just re-read your post, and saw that you wrote LV 7.0. Oh, well time to upgrade! ;)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.