Capturing an area of screen for comparision


Can eggPlant use images to create a rectangle area, capture the image within the rectangle and then use the captured image for comparison. What would be the script code to do this.

So from X point to Y point capture whatever is inside. Store this image so it can be used in the script.


This may or may not be exactly what you are looking to do, but it gives the basic concept of how you can capture an image of a certain area of the screen and use it later.

The example code below would be used in a scenario where you would capture the image, do something that may change how that looks, and then search for the image you captured to see if that area of the screen changed or not.

--SearchType is optional. Rectangle can be defined with images or coordinates.
captureScreen (Name: "ImageToCompare",rectangle:("Image1","Image2"))
put the result into ImageToCompareVar
//Do something that may change the image on screen
if imageFound(ImageToCompareVar, searchType:Tolerant) then
	log "Image Matched" 
	log "Image Didn't Match"
end if