Silverlight 筆刷應用教學(一)

摘要:Silverlight 筆刷應用教學(一)

Silverlight 1.0 RC推出至今,您是否已體驗到Silverlight所帶來的強大特效,從前您或許覺得想達到這些特效功能簡直是很困難,或者要寫很複雜的Flash Action,但有了Silverlight之後,這種種的一切不再是天馬行空的想法,就差在您有多豐富的創意了。(不愧是號稱為Flash Killer)
今天就為各位帶來四種筆刷中的兩種基本應用範例(Image Brush and Video Brush)

 

Example:

<Canvas xmlns="http://schemas.microsoft.com/client/2007"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas>
<MediaElement x:Name="xVideo" Source="/XBox.wmv" AutoPlay="True" Volume="1" Balance="0" Opacity="0"></MediaElement>
<TextBlock FontSize="80" FontFamily="Arial Black">
<TextBlock.Foreground>
<ImageBrush ImageSource="/SunFlower.jpg" Stretch="Fill"></ImageBrush>
</TextBlock.Foreground>
      Image Brush
</TextBlock>

<TextBlock Canvas.Top="100" FontSize="80" FontFamily="Arial Black">
<TextBlock.Foreground>
<VideoBrush SourceName="xVideo" Stretch="Fill"></VideoBrush>
</TextBlock.Foreground>
      Video Brush
</TextBlock>
</Canvas>
</Canvas>

請將Example Code貼到您到XAML檔中,執行即可。

以上各位若有不懂的地方也可下載我的教學影片回去研究研究。

How to Use ImageBrush and VideoBrush
http://download.csdn.net/source/257334