Drawing two shapes with transparency in Android/Java

别等时光非礼了梦想. 提交于 2019-12-11 05:05:47

问题


I'm drawing two shapes in Android using paint and canvas. I applied transparency to the paint color, but now when the two shapes (same color) intersect the intersecting section comes out darker.

Does anyone know how to accomplish this?

Here is a quick look at my paint code (which... should be the only object necessary to complete this I imagine).

        Paint paint = new Paint();
paint.setColor(color);
paint.setAntiAlias(true);
paint.setStrokeWidth(strokeWidth);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setPathEffect(new CornerPathEffect(15));
paint.setStyle(Paint.Style.FILL);

来源:https://stackoverflow.com/questions/20009242/drawing-two-shapes-with-transparency-in-android-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!