Silverlight 动画性能

通过几个配置可以提高动画性能:

Desired Frame Rate

在WEB项目中配置:

Silverlight 动画性能
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" width="100%" height="100%">
<param name="maxFramerate" value="15" />
...
</object>
<iframe style="visibility:hidden;height:0;width:0;border:0px"></iframe>
</div>
Silverlight 动画性能

Hardware Acceleration

Silverlight 动画性能
<object data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" width="100%" height="100%">
<param name="enableGPUAcceleration" value="true" />
<param name="enableCacheVisualization" value="true" />
<param name="enableFrameRateCounter" value="true" />
Silverlight 动画性能

Bitmap Caching

Silverlight 动画性能
     <Canvas>
            <Image x:Name="img" Source="phone_booth.jpg" Stretch="None"
CacheMode="BitmapCache">
                <Image.RenderTransform>
                    <RotateTransform x:Name="rotateTransform"></RotateTransform>
                </Image.RenderTransform>
            </Image>
            <Button x:Name="cmd" Content="I GROW and SHRINK." Canvas.Top="70" Canvas.Left="10"
CacheMode="BitmapCache">
                <Button.RenderTransform>
                    <ScaleTransform x:Name="scaleTransform"></ScaleTransform>
                </Button.RenderTransform>
            </Button>
        </Canvas>
Silverlight 动画性能

动画对象还要设置

Silverlight 动画性能
<Button x:Name="cmd" Content="I GROW and SHRINK." Canvas.Top="70" Canvas.Left="10">
<Button.CacheMode>
<BitmapCache RenderAtScale="5"></BitmapCache>
</Button.CacheMode>
<Button.RenderTransform>
<ScaleTransform x:Name="scaleTransform"></ScaleTransform>
</Button.RenderTransform>
</Button>
Silverlight 动画性能

 

Silverlight 动画性能,布布扣,bubuko.com

Silverlight 动画性能

上一篇:web对象影响范围和生命周期


下一篇:Advanced Installer 制作.NetWeb部署安装包