绘图后如何在画布中更改Z的圆形高度?

时间:2016-09-19 08:01:37

标签: android android-studio canvas

我在画布上画了一个圆圈 然后我在它上面绘制另一个形状, 最终的结果应该是我需要绘制的新形状 在我正在绘制的第一个圆圈下面

有没有办法可以将旧圆圈的高度再次改为顶部?

我不想在所有内容上绘制另一个圆圈,因为我想将此功能调用3次,每秒4次

这是我的班级:

Paint ciclePaint = new Paint();
        ciclePaint.setColor(getResources().getColor(R.color.cicleShapeOutline));
        ciclePaint.setStrokeWidth(40f);
        ciclePaint.setStyle (Paint.Style.STROKE);

        Paint innerCiclePaint = new Paint();
        innerCiclePaint.setColor(getResources().getColor(R.color.cicleShapeOutline));
        innerCiclePaint.setStrokeWidth(3f);
        innerCiclePaint.setStyle (Paint.Style.STROKE);

        canvas.drawCircle(getWidth()/2f, getHeight()/2f, (600f), ciclePaint);

        canvas.drawCircle(getWidth()/2f, getHeight()/2f, (450f), innerCiclePaint);

        canvas.drawCircle(getWidth()/2f, getHeight()/2f, (300f), innerCiclePaint);

        canvas.drawCircle(getWidth()/2f, getHeight()/2f, (150f), innerCiclePaint);



        //THIS NEEDS TO SHOW BEFORE THE THREE CIRCLES

        Paint canvasFillForTestings = new Paint();
        canvasFillForTestings.setColor(getResources().getColor(R.color.colorAccent));

        canvas.drawPath( pathsArray.get(7), canvasFillForTestings);

1 个答案:

答案 0 :(得分:0)

您必须在圆圈之前绘制新形状以显示在下方。 z顺序取决于绘图顺序。