资料,教程,编程,文集
tSize="32" FontWeight="Bold"> LINEAR GRADIENT BRUSH <TextBlock.Foreground>
<GradientStop Color="Red" Offset="0.0" /> <GradientStop Color="Orange" Offset="0.2" /> <GradientStop Color="Yellow" Offset="0.4" /> <GradientStop Color="Green" Offset="0.6" /> <GradientStop Color="Blue" Offset="0.8" /> <GradientStop Color="Violet" Offset="1.0" /> </TextBlock.Foreground> <TextBlock.RenderTransform> </TextBlock.RenderTransform> </TextBlock>
<TextBlock Text="Rotated Text" FontSize="32" Foreground="Teal" Canvas.Top="300"> <TextBlock.RenderTransform> <RotateTransform Angle="90" /> </TextBlock.RenderTransform> </TextBlock>
<TextBlock Canvas.Top="400" FontSize="32" FontWeight="Bold" Foreground="Maroon" Text="Skewed Text"> <TextBlock.RenderTransform> </TextBlock.RenderTransform> </TextBlock> <TextBlock Canvas.Top="450"
FontSize="32" FontWeight="Bold" Foreground="Maroon" Text="Skewed Text"> <TextBlock.RenderTransform> </TextBlock.RenderTransform> </TextBlock>
</Canvas>
III.页面对应的 JS 文件代码(Default.aspx.js)
function createSilverlight() { Silverlight.createObjectEx({ source: "Page.xaml", parentElement: document.getElementById("SilverlightControlHost"), id: "SilverlightControl", properties: { width: "350", height: "1000",
version: "1.0", background: "white", isWindowless: "true", enableHtmlAccess: "true" }, events: {} }); } function onLoaded(sender, eventArgs) { }
8. 全屏支持功能 I. 页面代码(Default.aspx)
html xmlns="/1999/xhtml" >
II.Xaml 文件代码
<Canvas xmlns="/client/2007" xmlns:x="/winfx/2006/xaml" Width="300" Height="300" Loaded="onLoaded"> <MediaElement Name="media" Source="/mymtv123/许志安_光辉岁月.wmv"
Width="300" Height="300" MouseLeftButtonUp="onMouseLeftButtonUp" </Canvas>
/>
III.页面对应的 JS 文件代码(Default.aspx.js)
function createSilverlight() { Silverlight.createObjectEx({ source: "Page.xaml", parentElement: document.getElementById("SilverlightControlHost"), id: "SilverlightControl", properties: { width: "350", height: "500", version: "1.0", background: "white", isWindowless: "true", enableHtmlAccess: "true" }, events: {} }); } //双击事件 function onMouseLeftButtonUp(sender, mouseEventArgs) { //plugin.content.fullScreen = !plugin.content.fullScreen; var b=(new Date).getTime(),c=this._timeLastLeftButtonUp; this._timeLastLeftButtonUp=b; var a=c&&b-c<300; if(a) { //处理双击事件 this._timeLastLeftButtonUp=0; var plugin=sender.getHost(); plugin.content.fullScreen = !plugin.content.fullScreen; } else { //处理单击事件
} } var media; function onLoaded(sender, mouseEventArgs) { media = sender.findName("media"); //处理FullScreenChangeded事件 plugin = sender.getHost(); plugin
.content.onFullScreenChange = onFullScreenChanged; updateLayout(plugin.content.actualWidth, plugin.content.actualHeight); } function onFullScree

