答案 0 :(得分:0)
我选择的方法是使用uiElement.Clip属性。它允许您仅剪切矩形,因此您需要多次剪辑。
我将三个剪裁方块组合在一起旋转了0度,30度和60度,并使用了一个薄的重叠圆边框来隐藏十二边形的角落。这是代码,以防有人需要它:
<Ellipse x:Name="Ellipse" Fill="#FF8813B4" Height="85" Margin="0" Width="85" StrokeThickness="0"
HorizontalAlignment="Center" VerticalAlignment="Center" />
<Grid Width="84" Height="84" HorizontalAlignment="Center">
<Grid>
<Grid>
<TextBlock x:Name="Label" Text="Tample" FontSize="70" HorizontalAlignment="Left" VerticalAlignment="Center"
FontFamily="Open Sans Semibold" Margin="0,2,0,0" Foreground="#7FFFFFFF" FontWeight="Bold"/>
<Grid.Clip>
<RectangleGeometry Rect="0,0,84,84">
<RectangleGeometry.Transform>
<CompositeTransform Rotation="60" CenterX="42" CenterY="42"/>
</RectangleGeometry.Transform>
</RectangleGeometry>
</Grid.Clip>
</Grid>
<Grid.Clip>
<RectangleGeometry Rect="0,0,84,84">
<RectangleGeometry.Transform>
<CompositeTransform Rotation="30" CenterX="42" CenterY="42"/>
</RectangleGeometry.Transform>
</RectangleGeometry>
</Grid.Clip>
</Grid>
<Grid.Clip>
<RectangleGeometry Rect="0,0,84,84">
<RectangleGeometry.Transform>
<CompositeTransform Rotation="0" CenterX="42" CenterY="42"/>
</RectangleGeometry.Transform>
</RectangleGeometry>
</Grid.Clip>
</Grid>
<Ellipse Stroke="#FF8813B4" StrokeThickness="2" Width="87" Height="87" HorizontalAlignment="Center" VerticalAlignment="Center"></Ellipse>