Jump to content

screen capture difference?


 Share

Recommended Posts

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?

Link to comment
Share on other sites

Link to comment
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?

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...