怎样实现画一段圆弧的动画效果
比如我想画一个半圆的动画,相当于按半径顺时针画180度, 从无到有画出一个半圆弧,这样的动画silverlight怎么实现?
[解决办法]
思路如下,最底层是一个早就画好的圆型,然后第二层绘制一个矩形遮挡一半的圆形,第三层是一个大矩形,然后按照圆心旋转动画即可逐步显示绘制出圆形效果。
[解决办法]
用 Blend很容易
<sdk:Pagexmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
mc:Ignorable="d"
x:Class="SilverlightApplication1.Page1"
Title="Page1 Page"
d:DesignWidth="640" d:DesignHeight="480">
<sdk:Page.Resources>
<Storyboard x:Name="Storyboard1">
<DoubleAnimation Duration="0:0:2" To="90" Storyboard.TargetProperty="(Arc.EndAngle)" Storyboard.TargetName="arc" d:IsOptimized="True"/>
</Storyboard>
</sdk:Page.Resources>
<Grid x:Name="LayoutRoot" >
<ed:Arc x:Name="arc" ArcThickness="0" ArcThicknessUnit="Pixel" EndAngle="-90" Fill="#FFF4F4F5" Margin="161,99,224,121" Stretch="None" Stroke="#FFD60909" StartAngle="-90" UseLayoutRounding="False" StrokeThickness="5"/>
</Grid>
</sdk:Page>