问题所在:
在一个Canvas上 画600条Polyline,每条300个点,
然后 鼠标滚轮缩放 Canvas,每条曲线相应缩放,结果是 速度慢的叫人心慌慌。
据msdn说 StreamGeometry,DrawingVisual是轻量的,能提升性能,试过效果不明显,可能是我技巧有限。
代码如下:
cs:
xaml:
<Window x:Class="ttt.J"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="J" Height="700" Width="1200" WindowState="Maximized">
<Grid Name="ggg" Background="Transparent">
<Canvas Margin="30" Background="LightGray" Name="canvas1"></Canvas>
<RadioButton Height="16" HorizontalAlignment="Left"
Margin="30,8,0,0" Name="radioButton1"
GroupName="p" IsChecked="True" VerticalAlignment="Top"
Width="120"
Checked="radioButton1_Checked">50*300点数</RadioButton>
<RadioButton Height="16" HorizontalAlignment="Left"
Margin="156,8,0,0" Name="radioButton2" GroupName="p"
VerticalAlignment="Top" Width="120"
Checked="radioButton2_Checked">500*300点数</RadioButton>
<Button Height="23" HorizontalAlignment="Left" Margin="282,1,0,0"
Name="button1" VerticalAlignment="Top" Width="75"
Click="button1_Click">画--></Button>
</Grid>
</Window>
Code