0

I am trying to delete a path from a canvas or make it transparent, I am using the following method to do this:

    Canvas canvas = new Canvas(bmap);
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    paint.setColor(Color.TRANSPARENT);
    Path path=new Path();
//Add lines/arcs to path...
    paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));//tried SRC,CLEAR
    canvas.drawPath(path, paint);

But the path is being filled with black color, I want to make that transparent, is that possible?

OKAN
  • 421
  • 1
  • 5
  • 10

1 Answers1

0

yes it is possible. Try

paint.setAlpha(200);

you can insert values from 0 to 255.

nano_nano
  • 12,351
  • 8
  • 55
  • 83