3

i want the eraser to erase smoothly but in my activity by default it erase the lines on touch draw and erase the lines on touch is not proper.my code what i had worked on.

    public void Draw(){
           count=1;
            bmp = Bitmap.createBitmap(fullimage2.getWidth(), fullimage2.getHeight(), Config.ARGB_8888);
             c = new Canvas(bmp);
            fullimage2.draw(c);

             if(mode==0){
                 pnt.setColor(Color.BLACK);
                    pnt.setStyle(Paint.Style.STROKE);
                    pnt.setStrokeJoin(Paint.Join.ROUND);
                    pnt.setStrokeCap(Paint.Cap.ROUND);
                    pnt.setStrokeWidth(8);  

                    c.drawPath(path,pnt);
             }
             else{
                 pnt1.setXfermode(new PorterDuffXfermode(
                            PorterDuff.Mode.CLEAR));
                pnt1.setStrokeWidth(25);
                 pnt1.setStrokeCap(Paint.Cap.ROUND);
                 pnt1.setColor(Color.TRANSPARENT);
                 pnt1.setAlpha(0);
                    c.drawPath(path1,pnt1);
                    pnt1.setStyle(Style.STROKE);
                    pnt1.setMaskFilter(null);

                  pnt1.setAntiAlias(true);
             }
GOPATHI
  • 91
  • 1
  • 6

1 Answers1

0

Is the code you use to draw proper? Otherwise use the same code and for the erraser use the same color as your background. If you need better code to draw, ask!

Remi
  • 1,289
  • 1
  • 18
  • 52