Note that there are some explanatory texts on larger screens.

plurals
  1. PONon-smooth DoubleAnimation
    primarykey
    data
    text
    <p>I am using <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.doubleanimation.aspx" rel="nofollow"><code>DoubleAnimation</code></a> for zooming and panning in and out of map. My map is an image with huge resolution (15,000 x 8,438). The problem is that on first time the zoom animation is very faltering and not smooth, at second time it`s getting better and so on. How can I make my animation smoother or make some cashing of the image or animation before performing it, or maybe using other form of animation?</p> <p>My Code: </p> <pre><code>namespace AnimationTest { public partial class MainWindow : Window { ScaleTransform transP; TranslateTransform trans2P; DoubleAnimation animP; DoubleAnimation animYP; DoubleAnimation animXP; TransformGroup myTransformGroupP; public MainWindow() { InitializeComponent(); transP = new ScaleTransform(); trans2P = new TranslateTransform(); myTransformGroupP = new TransformGroup(); myTransformGroupP.Children.Add(transP); myTransformGroupP.Children.Add(trans2P); animP = new DoubleAnimation(1, 20, TimeSpan.FromMilliseconds(3000)); animXP = new DoubleAnimation(0, -14000, TimeSpan.FromMilliseconds(3000)); animYP = new DoubleAnimation(0, -4000, TimeSpan.FromMilliseconds(3000)); } private void button1_Click(object sender, RoutedEventArgs e) { image1.RenderTransform = myTransformGroupP; transP.BeginAnimation(ScaleTransform.ScaleXProperty, animP); transP.BeginAnimation(ScaleTransform.ScaleYProperty, animP); trans2P.BeginAnimation(TranslateTransform.XProperty, animXP); trans2P.BeginAnimation(TranslateTransform.YProperty, animYP); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload