I created my own image view to remove the selected part from bitmap images. There is an operation for the selection area to get rid of the current bitmap using path has a collection of points .
Here is the code snippet:
for (int i = points.size() - 2; i < points.size(); i++) {
if (i >= 0) {
Point point = points.get(i);
if (i == 0) {
Point next = points.get(i + 1);
point.dx = ((next.x - point.x) / 3);
point.dy = ((next.y - point.y) / 3);
} else if (i == points.size() - 1) {
Point prev = points.get(i - 1);
point.dx = ((point.x - prev.x) / 3);
point.dy = ((point.y - prev.y) / 3);
} else {
Point next = points.get(i + 1);
Point prev = points.get(i - 1);
point.dx = ((next.x - prev.x) / 3);
point.dy = ((next.y - prev.y) / 3);
}
}
}
path.cubicTo(prev.x + prev.dx, prev.y + prev.dy, point.x - point.dx,
point.y - point.dy, point.x, point.y);
paramCanvas.drawPath(path, paint);
Look at this output:

I used the clip path to get this part, but this does not work for me.
I am going to fix this selected part, so you can help me solve this problem. I would really appreciate any help. Thanks
source
share