Joost van Hamond Posted February 28, 2007 Report Share Posted February 28, 2007 Hello all, 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 Does someone know how to do this?? Regards, Joost Quote Link to comment
crelf Posted February 28, 2007 Report Share Posted February 28, 2007 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? Quote Link to comment
Yair Posted February 28, 2007 Report Share Posted February 28, 2007 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). Quote Link to comment
Joost van Hamond Posted February 28, 2007 Author Report Share Posted February 28, 2007 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 Quote Link to comment
crelf Posted February 28, 2007 Report Share Posted February 28, 2007 QUOTE(Joost van Hamond @ Feb 28 2007, 06:55 AM) All kind of webpages are examples, it's not for a specific webpage. ...then I agree with yen: you're looking for a clipboard function. Quote Link to comment
Jeff Plotzke Posted March 1, 2007 Report Share Posted March 1, 2007 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... Quote Link to comment
Mikkel Posted March 1, 2007 Report Share Posted March 1, 2007 QUOTE(Joost van Hamond @ Feb 27 2007, 12:14 PM) Hello all,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 Does someone know how to do this?? Regards, Joost 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! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.