How can I get WPF's ClipToBounds to work?

后端 未结 2 1737
攒了一身酷
攒了一身酷 2021-01-18 06:07

I have an application that displays an image inside of an Image object in WPF. The image is contained in a control whose xaml looks like:



        
2条回答
  •  攒了一身酷
    2021-01-18 06:39

    The above comment help me out. Nest one canvas in another, add ClipToBounds="True" to the parent and bind the nested height and width to the parent properties respectively.
    This way removes the need to perform transformations on the parent.

    
         
    
    

提交回复
热议问题