Archive for May, 2012

May 14th, 2012

Clipping Path nuance in WPF/Silverlight/WP7

When you’re working with clipping paths in WPF and/or Silverlight there is a little nuance that you need to know about. If the alignment of your path and the item your are masking are different you’ll get some pretty¬†bizarre¬†behavior. The item your masking will appear in the correct position, but the clipping path will appear offset.

The default orientation of a path is “Stretch” – this is not what you want in most cases.

Make sure that the alignment of both your Image (in this case) and your Path are set to ‘Left” and “Top”, otherwise your clipping mask will be offset.

This one stumped me for a while, so hopefully this saves someone else time.

 

 

 

 

 

You can quickly apply your clipping path to the item by selecting both the path and the item and then right clicking -> roll over PATH -> and select Make Clipping Path.