2017-07-08 5 views
0

I zwei Bögen als Pfad wie unten gezogen haben zu füllen,Wie zwei Bogen in Xamarin android

Path path = new Path(); 
path.ArcTo(rc, (float)startArc, (float)(angle1 - startArc)); 
path.ArcTo(innerrc, (float)(angle - startArc), (float)startArc); 
canvas.DrawPath(path, paint); 

Jetzt muss ich diese beiden Bögen füllen.

Irgendeine Idee zu diesem Thema? !

enter image description here

+0

'Farbe # setStyle'? – pskink

+0

Wenn ich setstyle als Füllung benutze, werden nur zwei Bögen gefüllt. Aber ich muss diese zwei Bögen füllen wie geschlossenen Pfad. Die unten ist für iOS, https://stackoverflow.com/questions/12370841/how-to-fill-space-between-two-uibezierpaths/44984775#44984775 ich das gleiche in Android benötigen. – Smile

+0

Redigiert meine Frage. Wenn ich Bogen mit dem Farbsatz style als Füllung zeichne, werden nur zwei Bögen gefüllt. – Smile

Antwort

0

habe es endlich und das funktioniert gut für mich!

Path path = new Path(); 
paint.SetStyle(Paint.Style.Fill); 
path.MoveTo((float)xnew, (float)ynew); 
path.ArcTo(rc, (float)startArc, (float)(angle1 - startArc)); 
path.LineTo((float)xnew1, (float)ynew1); 
path.ArcTo(innerrc, (float)(angle - startArc), (float)startArc); 
path.LineTo((float)xnew, (float)ynew); 
canvas.DrawPath(path, paint);