2014-12-03 76 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”