WPF imaging animation



  • Trying to create an effect like ru.4game.com/lineage2/install. I made some pictures, cut them off, and I want to get that effect when I press the button, but it only works with two (sing one on the other and then it changes again to the first one from the second) How do we do with the others?

    private void AnimUp(Image img) 
    { 
    im4_4.Margin = new Thickness(673, 686, -5, -686); 
    var animUp = new ThicknessAnimation(); 
    var animUp1 = new ThicknessAnimation(); 
    if (img.Margin == new Thickness(673, 0, -4, 0)) 
    { 
    animUp.To = new Thickness(673, -688, -4, 0); 
    animUp1.To = new Thickness(673, 0, -4, 0); 
    } 
    animUp.Duration = TimeSpan.FromMilliseconds(500); 
    animUp1.Duration = TimeSpan.FromMilliseconds(500); 
    img.BeginAnimation(Image.MarginProperty, animUp); 
    im4_4.BeginAnimation(Image.MarginProperty, animUp1); 
    } 
    private void AnimDw(Image img) 
    { 
    im4.Margin = new Thickness(0, -687, 0, 0); 
    var animDw = new ThicknessAnimation(); 
    var animDw1 = new ThicknessAnimation(); 
    if (img.Margin == new Thickness(0, 0, 0, 0)) 
    { 
    animDw.To = new Thickness(0, 687, 0, -687); 
    animDw1.To = new Thickness(0, 0, 0, 0); 
    } 
    animDw.Duration = TimeSpan.FromMilliseconds(500); 
    animDw1.Duration = TimeSpan.FromMilliseconds(500); 
    img.BeginAnimation(Image.MarginProperty, animDw); 
    im4.BeginAnimation(Image.MarginProperty, animDw1); 
    } 
    private void btnSlide_Click(object sender, RoutedEventArgs e) 
    { 
    AnimDw(im5); 
    AnimUp(im5_5); 
    }
    


  • Add the pictures of the substrate. As soon as the animation is over, you're putting the right image and pictures on the substrate, and the pictures with which the animation is hidden. When they're hidden, you're returning to the original coordinates. Before the next animation, the procedure is repeated. The subscriptions are closed and the workers show and start animation. The user won't notice anything, and you'll get the right effect.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2