Skip to main content

Region

When searching for images on your screen, nut.js uses the Region datatype to represent a 2D area on your screen.

A Region holds a left, top, width and height property to represent its size and location, as well as an area() method that calculates the area occupied by a particular Region

Sample#

const r = new Region(10, 100, 400, 300);
console.log(r);
const regionArea = r.area();