Page 1 of 1

Is clipping mask supported?

Posted: 07 May 2014, 03:50
by PandaChuZero
One more question,

Is clipping mask supported for organic or non linear shapes. And can the mask be altered at runtime for closing window effects and such.

For example as seen in this tutorial ?

https://www.youtube.com/watch?v=lcDFQ5cfJe4#t=115

Thanks!

Re: Is clipping mask supported?

Posted: 07 May 2014, 12:44
by sfernandez
Hi,

You can apply any clip geometry to the Clip property of all UI elements. For example:
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Rectangle Width="400" Height="200" Fill="Red">
        <Rectangle.Clip>
            <RectangleGeometry Rect="10,10,180,180" RadiusX="20" RadiusY="20"/>
        </Rectangle.Clip>
    </Rectangle>
    <Rectangle Width="400" Height="200" Fill="Green"
        Clip="M300,0L320,80 400,100 320,120 300,200 280,120 200,100 280,80z"/>
</Grid>
Resulting in the following render:
clip-paths.png
clip-paths.png (3.01 KiB) Viewed 3193 times