Silverlight animation performance

9075 단어 silverlight
Animation performance can be improved with several configurations:
Desired Frame Rate
Configure in the WEB project:

<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>
Hardware Acceleration

<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" />
Bitmap Caching

     <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>
The animation object also needs to be set

<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>

좋은 웹페이지 즐겨찾기