wpf 裁剪超出容器的部分
该方法可适用于所欲容器类型,相关属性:ClipToBounds
举例:
代码:
<Canvas ClipToBounds="False" Height="100" Width="100" Background="Yellow">
<Ellipse Fill="Green" Height="100" Width="100" Canvas.Left="60"/>
</Canvas>
结果:
代码:
<Canvas ClipToBounds="True" Height="100" Width="100" Background="Yellow">
<Ellipse Fill="Green" Height="100" Width="100" Canvas.Left="60"/>
</Canvas>
结果: