2013-03-21 169 views
-1

我有問題,C#路徑中的半圓形矩形

我有圓角矩形。它只在右側圓角,並在左側直行。我想以其他方式製作 - 左轉,右轉。 我應該改變什麼?

int ArcWidth = 10 * 2; 
int ArcHeight = 10 * 2; 
int ArcX1 = Rect.Left; 
int ArcX2 = Rect.Right -(ArcWidth + 1); 
int ArcY1 = Rect.Top; 
int ArcY2 = Rect.Bottom -(ArcHeight + 1); 

path.AddArc(ArcX1, ArcY1, 1, 1, 180, 90); // Top Left 
path.AddArc(ArcX2, ArcY1, ArcWidth, ArcHeight, 270, 90); //Top Right 
path.AddArc(ArcX2, ArcY2, ArcWidth, ArcHeight, 360, 90); //Bottom Right 
path.AddArc(ArcX1, ArcY2, 1, ArcHeight, 90, 90); //Bottom Left 
+0

他使用的WinForms – plast1K 2013-03-21 14:46:43

+1

他使用的WinForms,雖然 – 2013-03-21 14:46:48

+0

是的,我使用WinForms。 – boski 2013-03-21 15:31:39

回答

0

切換圓角的邊。看起來你已經全部擺放好了。切換所有號碼。

+0

當我切換雙方我的矩形被截斷(一半大小)。 – boski 2013-03-21 15:34:25

+0

您是否嘗試過改變錨定方式或對齊方式? – plast1K 2013-03-21 15:35:20

+0

我試過改變ArcX1 - > X2等,但唯一的好方法是將右上角的高度更改爲1,然後它看起來像http://s22.postimg.org/wwlp3hjd9/img.png?noCache=1363881618 – boski 2013-03-21 16:01:20