canvas - Android Use finger to erase bitmap transparency and match background -
scenario:
- use
fingerpaint
example basis - draw text
fingerpaint
region - want user able erase part of text finger dragging on it
reference: how erase paint finger
tries:
it gets want, src
, clear
dragging path black. prefer dragging path color drawn canvas without redrawing entire canvas finger moves.
if know fingerpaint this:
canvas.drawcolor(0xffaaaaaa);
i wrote black colored text on top of canvas via drawtext.
tried following combos allow user erase text:
mpaint.setcolor(0xffaaaaaa); mpaint.setxfermode(new porterduffxfermode(porterduff.mode.clear)); mpaint.setcolor(color.transparent); mpaint.setxfermode(new porterduffxfermode(porterduff.mode.clear)); mpaint.setcolor(0x00aaaaaa); mpaint.setxfermode(new porterduffxfermode(porterduff.mode.clear));
you can multiply 3 out substituting clear
mode src
mode , showed same result.
question:
anyone know how can make erasure drawpath
take appropriate action of erasing part of bitmap dragged on , while doing path being dragged should match color drawn canvas underneath text?
Comments
Post a Comment