So I made a function to capture images to limit the time it takes to capture lots of images.
So I call the function
“CaptureImageScript”.CaptureImages (the folder of my folder,(200,200),(500,400),“BackgroundPatternFill” ,“Pulsing”, 4)
Parameter 2 top left coordinate and 3 bottom right coordinate for the capture rectangle.
Then in the function it captures like this.
CaptureScreen(Name: item 1 of params & “Result” & cnt, rectangle:((item 2 of params),(item 3 of params)), ImageInfo: CaptureInfo)
I just set the SearchType and Discrepency for Image Info.
When I use the Image Doctor the Original Location is set to 150, 100
Is it Info you are looking at in Image Doctor? That’s the Hot Spot, which by default is the center of the found image. (500-200)/2, (400/200)/2 seems right to me.
-edj
You also need to specify the capture location in your image information property list.
Here is an example:
to CaptureImage name, rect
put the folder of my folder & "Images/" into path
put (CaptureLocation:item 1 of rect, SearchType:..., ) into info
CaptureScreen(ImageName:path & name, rectangle:rect, ImageInfo:info)
put imageSize(name)
put imageInfo(name)
end captureimage
Thanks for the post – that appears to be a bug with the CaptureScreen command (that it doesn’t record the original location).
That has been corrected for the next release of Eggplant but in the meantime you can fix it in your script by adding CaptureLocation to the image info:
CaptureLocation:(200,200)
NOTE: Regardless of how you might see that reported by the image doctor, internally it needs to be recorded as the UPPER LEFT coordinate of the capture.