如何用手指android

时间:2018-02-06 02:19:03

标签: java android canvas draw erase

我有代码:

@Override
protected void onDraw(final Canvas canvas) {
 super.onDraw(canvas);
 if (DrawInfor.mDrawing != null) { //this is array path
        if (DrawInfor.mDrawing.size() > 0) {
           for (DrawingObject drawobj: DrawInfor.mDrawing) {
            canvas.drawPath(drawobj.getPath(), mPaint);
           }
        }
    }
}

当我选择擦除时,我设置:

m_Paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
m_Paint.setStrokeWidth(30);

但它不起作用,画布画黑线

screenshot

我该怎么办?我不能删除arraylist因为我需要它用于许多功能

0 个答案:

没有答案