Comment 6 for bug 874033

Revision history for this message
RaiMan (raimund-hocke) wrote :

@xianming

Maybe this is clear for you, but might not be for others:

You use setROI() in a function to define the region, that should be highlighted. This works, but has the side effect, that from now on ALL subsequent unqualified (searching the primary screen) find operations will be restricted to the screen region set by setROI(). So this is ok, if you know what you are doing: work only in the restricted area or reset ROI to other settings later on (e.g. setROI(SCREEN).

So because of this side effect, setROI() is not recommended to be used only for defining the region on the screen to be highlighted.
use instead:
reg = Region(<same settings as with setROI()>)
reg.highlight()