Region
Regions in Android Macro allow you to define specific areas on the screen for interaction and recognition. They are useful for limiting where the macro searches for templates or performs actions.
Types of Regions
1. Basic Region
A basic Region defines a rectangular area using x, y coordinates and width, height dimensions.
Parameters:
- x: The horizontal coordinate of the top-left corner
- y: The vertical coordinate of the top-left corner
- width: The width of the region in pixels
- height: The height of the region in pixels
2. Using Regions
Regions can be used to:
- Restrict template matching to a specific area
- Define clickable zones
- Create boundaries for swipe gestures
- Optimize performance by reducing the search area
Example: Template Matching in Region
Here's an example of searching for a template within a defined region:
Tips for Using Regions
- Use regions to improve macro performance by limiting search areas
- Make regions slightly larger than needed to account for screen variations
- Consider device resolution when defining region dimensions
- Test regions with different screen orientations
- Use variables to store frequently used regions