使用Silverlight创建文字遮罩特效要比Flash中的遮罩效果简单一些,ImageBrush可以轻松帮你搞定,不说费话,一看代码便知!
<Canvas
xmlns=" "
xmlns:x=" "
x:Name="parentCanvas"
Loaded="Page_Loaded"
x:Class="DFModules.Page;assembly=ClientBin/DFModules.dll"
Width="640"
Height="480"
Background="White"
>
<TextBlock
Text=" "
Canvas.Top="195"
FontFamily="Verdana"
FontWeight="Bold"
FontSize="30" Canvas.Left="42">
<TextBlock.Foreground>
<ImageBrush ImageSource="5.jpg" />
</TextBlock.Foreground>
</TextBlock>
<TextBlock
Text=" "
Canvas.Left="63.05" Canvas.Top="244"
FontFamily="Verdana"
FontWeight="Bold"
FontSize="50">
<TextBlock.Foreground>
<ImageBrush ImageSource="4.jpg" />
</TextBlock.Foreground>
</TextBlock>
本文转自dotfun 51CTO博客,原文链接:http://blog.51cto.com/dotfun/285996