Code example for Region

Methods: contains, setPath

0
    } 
 
    public boolean contains(float x, float y) {
        rectF = new RectF();
        path.computeBounds(rectF, true);
        Region region = new Region();
        region.setPath(path, new Region((int) rectF.left, (int) rectF.top, (int) rectF.right, (int) rectF.bottom));
        return region.contains((int) x, (int) y);
    } 
 
    @Override 
    public void clean() { 
        super.clean(); 
        p = null;
        path = null;
        rectF = null;
    } 
}