我有一个多面的位图。我想突出显示每张脸,使得脸部矩形具有原始颜色,并且该区域的其余部分被涂黑。
我做了类似的事情,
for(int i=0; i<getNumFaces(); i++)
{
Rect rect = getRect();
canvas = new Canvas(mutableBitmap);
canvas.clipRect(rect, Region.Op.DIFFERENCE);
canvas.drawColor(Color.BLACK, Mode.SRC_ATOP);
}
confirmationView.setImageBitmap(mutableBitmap);
但这会使我的整个图像变黑。我有点知道原因,但无法找到解决方案。