← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #700981]: Is it possible with sikuli to take a screenshot, within the screenshoted image create a rectangle around the text then read that text or text?

 

Question #700981 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/700981

    Status: Open => Answered

RaiMan proposed the following answer:
if I understand right:

regionOfImage = find(someImage)

now you want to read the text in some smaller region inside the found
image?

You can calculate the new region based on the (x, y) of the given
region:

newX = regionOfImage.x + xOff
newY = regionOfImage.y + yOff
textRegion = Region(newX, newY, w, h)

xOff, yOff, w, h have to be given or calculated before.

There are also some functions to define a new region based on a given one:
https://sikulix-2014.readthedocs.io/en/latest/region.html#extend-regions-and-create-new-regions-based-on-existing-regions

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.