开发者

Silverlight clipping inside grid

开发者 https://www.devze.com 2023-04-03 07:37 出处:网络
I have a Grid and I\'d like to apply a Clip( I provide Path Data ) to anything that is inside the Grid. For e开发者_StackOverflow中文版.g., if I have an image inside the grid, I need the image to be c

I have a Grid and I'd like to apply a Clip( I provide Path Data ) to anything that is inside the Grid. For e开发者_StackOverflow中文版.g., if I have an image inside the grid, I need the image to be clipped to a custom shape. How can I achieve this?


Yes, you can set the Clip property on the Grid to the geometry that you want to clip to. Alternatively, there is an attached behaviour described in the following blog post:

http://www.scottlogic.co.uk/blog/colin/2009/05/silverlight-cliptobounds-can-i-clip-it-yes-you-can/

That can be used as follows:

<Grid util:Clip.ToBounds="true"> 
0

精彩评论

暂无评论...
验证码 换一张
取 消