Sign in to follow this  
Followers 0
zzacreek

screen capture difference?

5 posts in this topic

i have created a program that takes a screen capture of a program.

i used the fallowing command:

_ScreenCapture_CaptureWnd ("C:\work\FundlinxPB730\Auto_Scripts\ddsecure_test\test1\test\base1.jpg", $hGUI,0,0,-1,-1,false)

however each time the program runs and saves off the base1.jpg the image is different and the size of the image is different. Which leads to my test failing because of the image not being the same?

My screen settings are the same? So i don't know what i am doing wrong?

is there a better way to test a screen to make sure it is the same?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Share this post


Link to post
Share on other sites

here is the full code:

WinActivate("FUNDLinx Security Manager © Delta Data Software, Inc.")

$hGUI = WinGetHandle("FUNDLinx Security Manager © Delta Data Software, Inc.")

Sleep(500)

_ScreenCapture_CaptureWnd ("C:\work\FundlinxPB730\Auto_Scripts\ddsecure_test\test1\test\base1.jpg", $hGUI,0,0,-1,-1,false)

from some reason the picture is not the same size each time this code runs?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Are you using Vista? If so, it may be that the glass theme is causing the effect to be different from run to run but on the same run the files are same size:

#include <ScreenCapture.au3>

Run("calc.exe")
WinWaitActive("[CLASS:SciCalc]")
Sleep(500)
_ScreenCapture_CaptureWnd(@ScriptDir & "\test.jpg", WinGetHandle("[CLASS:SciCalc]"), 0, 0, -1, -1, False)

Sleep(1000)
_ScreenCapture_CaptureWnd(@ScriptDir & "\test1.jpg", WinGetHandle("[CLASS:SciCalc]"), 0, 0, -1, -1, False)

Edit: A solution to this might be to get the rect of the client area using _WinAPI_GetClientRect() create two points (i.e DllStructCreate($tagPOINT)) for [left, top] and [right, bottom] and call _WinAPI_ClientToScreen() and call _ScreenCapture_Capture() with the translated coordinates.

Edited by Authenticity

Share this post


Link to post
Share on other sites

I am not using vista i am using XP.

The really odd thing is that when i run the script outside of scheduled task it works fine. But when the task is scheduled in windows it takes different screen shoots then it does when it is not scheduled?

Another thing is what other settings are needed to make screen shoots the same across different computers? I have the screen resolution the same on two different computers. However the image they produce is different in size. But the picture itself looks the same?

I shall try what you said. i use script writer to write some of the test how do i take screen shoots with it?

thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0