locked
Animation flickers the first time. RRS feed

  • Question

  • Hi, I am using Silverlight 5 to animate an explosion using a storyboard and "ObjectAnimationUsingKeyFrames" and changing the source image. However, the animation flickers the first time it runs. I have searched for solutions and have learned that in Silverlight the UI thread handles the first playthrough so do I need to double buffer or something?

    Thanks in advanced.

    Wednesday, November 6, 2013 9:52 PM

Answers

  • I solved it myself by adding an image for each of the animation frames and setting them to Collapsed Visibility.

    • Marked as answer by Battlingbean Saturday, November 9, 2013 2:54 AM
    Saturday, November 9, 2013 2:54 AM

All replies

  • Hi,

    A.Wieser has answered the similar question before.

    If you run a SL Application a single Thread will be created for you, the UI Thread.
    A single Thread can only execute 1 command at a time, so all commands have to be queued.

    And using the second thread just merges your commands into the UI Thread without creating huge gaps, which will compromise the rest.

    You may check the link below for details:

    Animation flickers during GUI processing

    http://social.msdn.microsoft.com/Forums/en-US/03432072-b302-493c-b7d7-48de56dfc197/animation-flickers-during-gui-processing?forum=silverlightstart

    Please provide us with some working code to test if the method above does not work.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 7, 2013 1:19 PM
  • Thanks for the response. I have set up a small App to show the problem. Even though the user code does nothing else except play the animation, there is still flickering the first play through.



    • Edited by Battlingbean Saturday, November 9, 2013 3:58 AM Removed Code
    Friday, November 8, 2013 12:32 AM
  • I solved it myself by adding an image for each of the animation frames and setting them to Collapsed Visibility.

    • Marked as answer by Battlingbean Saturday, November 9, 2013 2:54 AM
    Saturday, November 9, 2013 2:54 AM