2016-09-19 31 views
0

我有一個圓我畫在我的畫布上 然後我在上面畫了另一個形狀, 最終的結果應該是,我要畫的新形狀需要是 在我畫第一個圓的下方如何更改Z繪圖後畫布中的圓形高程?

有沒有辦法改變老圓的高程再次在頂部?

我不想動用一切之上另一個圈子,因爲我想調用這個函數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); 

回答

0

您必須繪製圓圈之前的新形狀出現在下方。 z順序取決於繪製順序。

+0

事情是我會一直繪製新的形狀後,因爲它來作爲後來的輸入。之後,我可以畫出一個新的形狀,但是它會在應用程序中變得非常沉重 –

相關問題