0

我有一个Grid&StarPath

 <Path x:Name="StarPath" Data="M213,135 L183,213 L87,246 L159,288 C159,288 140,372 140,375 C140,378 226,329 226,329 L303,367 L280,275 L316,216 L246,219" Fill="#FF0EB679" HorizontalAlignment="Left" Height="241.132" Margin="86.5,134.5,0,0" Stretch="Fill" Stroke="Black" UseLayoutRounding="False" VerticalAlignment="Top" Width="230"/>
 <Grid HorizontalAlignment="Left" Height="300"  Width="300" Background="#FFD11010"/> <br/><br/>

我正在尝试获取我的Grid in the shape of Star shaped Path.
任何人都可以为我提供任何提示或样本Clipping Grid by Path by Code吗?

4

1 回答 1

0

您可以尝试调整此方法...

MyGrid.Clip = getPathGeometry(StarPath.Data.ToString());

您必须添加“||” 在 if 测试中,并更改 data.replace 为data = data.Replace("M", " M").Replace("C", " C").Replace("L", " L");

于 2013-04-26T10:12:49.687 回答