List of usage examples for android.graphics Region setPath
public boolean setPath(Path path, Region clip)
From source file:Main.java
/** * Creates a simple region from the given path. * * @param path given path/*from ww w . j a v a 2s .co m*/ * @return region object */ public static Region createRegionFromPath(Path path) { Region region = new Region(); if (path != null) { RectF box = new RectF(); path.computeBounds(box, true); region.setPath(path, new Region((int) box.left, (int) box.top, (int) box.right, (int) box.bottom)); } return region; }