Question

I am using AvoidXferMode to draw Paths only above the black color, but there is a problem, the border of the paths get colored black and it gets all messed up..

I will show you the photos to better understanding

This is the image before draw.. just a black square.. Before Drawing

This is the starting of the draw, using Path. Starting the draw..

And then finnally when I get the entire square drawned using various Paths, it gets this aspect After the draw

Does anyone knows how to fix this? I don't want to see black lines around the several Paths..

This might be a bug of AvoidXferMode?

This is my paint object:

    Xfermode mode = new AvoidXfermode(Color.BLACK, 0, AvoidXfermode.Mode.TARGET);

    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setDither(true);
    mPaint.setColor(Color.YELLOW);
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);
    mPaint.setStrokeWidth(stroke);
    mPaint.setXfermode(mode);

Thanks alot in advance ;)

Was it helpful?

Solution

As a test, try setting anti-aliasing to false. You might be seeing artifacts where the edges of your yellow strokes were dithered over the black background.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top