首页 新闻 会员 周边 捐助

■■■ 请教WPF 2D图形 性能提升。牛人进来施法,菜鸟进来观望。多谢了!

-1
悬赏园豆:50 [已关闭问题]

问题所在:

在一个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
问题补充: 代码折叠了,在下面,谢谢
千哥的主页 千哥 | 菜鸟二级 | 园豆:250
提问于:2009-05-12 21:30
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册