views:

35

answers:

1

in a canvas, i have around 2000 framework element derived items.. which inturn consist of around a total of 12000 drawing visuals. This canvas represents a 2d view of a complex machine. And this canvas has pan and zoom logic.
The drawing comes in a jiffy.. but when the machine/drawing is fully loaded.. then the pan and zoom is very jittery..

I could apply bitmapcache feature in .net4 to make it blazing fast. Then the problem is, when the canvas is zoomed into see the details.. pixel blocks can be seen.. which is very ugly..

Is there any way to speed up this.?

A: 

How are you doing your pan and zoom? If they're being done in a way that invalidates the Canvas's layout then it's possible that you're doing a full Measure and Arrange pass (or just Arrange) on every frame, which slows down very quickly with that many elements. If you can do the manipulations using the Canvas's RenderTransform the layout won't need to be recalculated on every movement.

The other thing to try would be to try to reduce the number of FrameworkElements as much as possible, maybe by having a middle-man that takes a bunch of your current objects and spits out a single Visual to represent all of them in this view. Obviously there won't be the same interaction capabilities doing this, but again I'm not sure of your specific needs.

John Bowen
Socrates