|
-
June 28th, 2006, 03:57 AM
#1
Taking screenshot of IE
Hi
I want to take the screenshot of the web sites look in IE. The main challenge is to detect the IE in the screen and removing the unnecessary parts of it. For instance the screenshot should not contain start menu(easy part i think), any installed toolbars to IE and any borders.
Any help will be appreciated
Thanks,
Batuhan Uslu
-
June 28th, 2006, 05:47 PM
#2
Re: Taking screenshot of IE
You can use the java.awt.Robot class to get a screen shotof the desktop and process from there.
"The Chicken and Rice MRE is not a personal lubricant."
-
June 29th, 2006, 01:29 AM
#3
Re: Taking screenshot of IE
The main point is not taking screenshot, detecting where ie is placed.. However i have somehow solved the detecting ie part with searching for a color match however it is not the best answer of this problem..
-
June 29th, 2006, 03:01 AM
#4
Re: Taking screenshot of IE
Using the Robot class you can screen capture a given Rectangle. So if you can click the top left point of where you want the capture to be taken from and the bottom right point, then you can take those coordinates and build a Rectangle. Pass the Rectangle to Robot.createScreenCapture(Rectangle) and you will have a screen capture of all you want.
Hope this helps
Byron Tymvios
Please use [ CODE ] and [/ CODE ] tags when posting code! See THIS on how to use code tags.
-
June 29th, 2006, 05:46 AM
#5
Re: Taking screenshot of IE
However if we consider this operation will be done by an automation program things get worse
By the way i've solved problem temporarly with detecting the pixel colors of ie and seems it worked. However it is not stable for now
Anyway thanks...
-
June 29th, 2006, 06:11 AM
#6
Re: Taking screenshot of IE
Have you considered hard coding the co-ordinates? It's not the cleanest method, but then neither is comparing pixels. If it's on the same machine, then the position of the bars in IE shouldn't change, so you can hard code them in and then use the aforementioned method.
Byron Tymvios
Please use [ CODE ] and [/ CODE ] tags when posting code! See THIS on how to use code tags.
-
June 29th, 2006, 06:52 AM
#7
Re: Taking screenshot of IE
There must be windows commands to give you an applications window name and coordinates just search the windows help or docs. this would be much cleaner and reliable. You can then call em thru java and parse the input as per your need.
-
June 29th, 2006, 07:49 AM
#8
Re: Taking screenshot of IE
 Originally Posted by tbear
There must be windows commands to give you an applications window name and coordinates just search the windows help or docs. this would be much cleaner and reliable. You can then call em thru java and parse the input as per your need.
i tried to find those commands however i couldn't
-
June 29th, 2006, 07:52 AM
#9
Re: Taking screenshot of IE
 Originally Posted by Bnt
Have you considered hard coding the co-ordinates? It's not the cleanest method, but then neither is comparing pixels. If it's on the same machine, then the position of the bars in IE shouldn't change, so you can hard code them in and then use the aforementioned method.
Assume this system will test at least 10 hours, if there will be a 1 pixel movement at ie, whole test will fail, so think the thing that i'm trying to make is a emergency brake..
-
June 29th, 2006, 08:24 AM
#10
Re: Taking screenshot of IE
 Originally Posted by batuj
i tried to find those commands however i couldn't 
There are definitely Windows API methods that will return this information - however, you would need to access them via JNI.
Don't tell people how to do things. Tell them what to do and let them surprise you with their results...
G. Patton
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|