2014-12-03 34 views
0

這是關於具有邊框半徑的矩形的一般問題。我正在與一位開發人員合作,他們將我的Photoshop複合材料應用於Blend中的原型。他們告訴我,在Blend中不可能創建一個只有2個彎角的矩形。假設你必須有一個邊界半徑的所有4個角落或根本沒有。理想情況下,我只想要左上角和右下角的邊界半徑爲10,底邊沒有曲線。我只想知道這是否可行。矩形CornerRadius

Refer to example below

+0

哈哈這聽起來很熟悉,如果你的開發者的名字是詹姆斯告訴他聯繫我。 ;) – 2014-12-05 14:34:11

回答

2

使用剪輯:RectangleGeometry

<Rectangle Fill="Blue" HorizontalAlignment="Center" VerticalAlignment="Center" Height="200" Width="200"> 
    <Rectangle.Clip>   
      <RectangleGeometry Rect="0,20,200,200" RadiusX="20" RadiusY="20"/>               
    </Rectangle.Clip> 
</Rectangle> 

使用VisualBrush

<Rectangle> 
    <Rectangle.Fill> 
     <VisualBrush Stretch="None"> 
      <VisualBrush.Visual> 
       <Border CornerRadius="50,50,0,0" Width="300" Height="200" Background="Navy"></Border> 
      </VisualBrush.Visual> 
     </VisualBrush> 
    </Rectangle.Fill> 
</Rectangle> 

enter image description here

3

它不能夠以矩形。但它可以使用邊框。

<Border Width="230" Height="100" CornerRadius="10 10 0 0" Background="red"/> 

值會以這種方式被應用 - 「左上TopRight BottomRight BOTTOMLEFT」