How to draw Shape exclusively inside Canvas

后端 未结 1 1640
生来不讨喜
生来不讨喜 2021-01-06 08:09

I have a Shape inside Canvas, like this:



    

        
相关标签:
1条回答
  • 2021-01-06 08:26

    This is what the ClipToBounds property was made for:

    <Canvas Background="White" ClipToBounds="True"> 
        <Rectangle Width="200" Height="200" Canvas.Left="103" Canvas.Top="186" Fill="Red" /> 
    </Canvas> 
    
    0 讨论(0)
提交回复
热议问题