Android : Android Photo Background Eraser need help- Not erasing bitmap but just draws black lines

on Monday, August 4, 2014


I am developing 1 app in that i need to erase the Bitmap for that i have done is



@Override
protected void onDraw(Canvas canvas) {

canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
for (PathPoints p : paths) {
mPaint.setColor(p.getColor());
mPaint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
Log.v("", "Color code : " + p.getColor());
if (p.isTextToDraw()) {
canvas.drawText(p.textToDraw, p.x, p.y, mPaint);
} else {
canvas.drawPath(p.getPath(), mPaint);
}
}


But the above code only draws the black lines on Bitmap I have Seen this link But not getting Actually I want it LIKE THIS


0 comments:

Post a Comment