[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Smooth animation in wpf

Asked by inspire-it in WPF and Silverlight

Tags: banner ticker marquee scroll animation smooth fast

I have an application, implemented in WPF, that presents various media on full screen, such as movies, images, text etc.
these views can be presented in a slide-show, much like in PowerPoint.
each transition between two views can be animated so that it blends from one view to another in different ways. I use transparency in different forms for this, either through a OpacityMask with GradientBrush, where the different stops are animated or I animate the Opacity property directly on the view-panels.
I addition to this I have a banner/ticker/marquee with text that scrolls over the lower part of the screen from right to left. The text background is semi-transparent.

The problem is that during the transition animations the scolling is very jerky, and even when only showing a movie in the background the scrolling is not perfectly smooth. I want the banner to scroll perfectly smoothly regardless of the background, as can be seen in advertisement displays in super markets for instance.

My computer is dual core 2.00 GHz Intel with 2 GB RAM and running vista.

Is this the kind of performance that can be expected from WPF? Or is there a way to accellerate the animation(s). Is there for instance a way to synchronize the two animations better, or forcing/enabling more of the computations to be made on the graphics card instead of in memory? I have also seen that you can plug in DirectX-scripts written in HLSL. Is this the way to go to make the animations smoother?

See exampel code for animating the transitions between two views below
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
public override void BringIn()
		{
			NameScope.SetNameScope(fadeInPanel.Parent, new NameScope());
			fadeInPanel.RegisterName(fadeInPanel.Name, fadeInPanel);
			DoubleAnimation animation = new DoubleAnimation();
			animation.From = 1;
			animation.To = 0;
			animation.Duration = new Duration(new TimeSpan(Duration.Ticks / 2));
			Storyboard sb = new Storyboard();
			sb.Children.Add(animation);
			Storyboard.SetTargetName(animation, fadeInPanel.Name);
			Storyboard.SetTargetProperty(animation, new PropertyPath(Panel.OpacityProperty));
			sb.Completed += new EventHandler(sb_bringInCompleted);
			sb.Begin(fadeInPanel);
		}
 
		public override void BringOut()
		{
			fadeOutPanel.Opacity = 0;
			((ViewPanel)FromPanel).Mount(fadeOutPanel);
			NameScope.SetNameScope(fadeOutPanel.Parent, new NameScope());
			fadeOutPanel.RegisterName(fadeOutPanel.Name, fadeOutPanel);
			DoubleAnimation animation = new DoubleAnimation();
			animation.From = 0;
			animation.To = 1;
			animation.Duration = new Duration(new TimeSpan(Duration.Ticks / 2));
			Storyboard sb = new Storyboard();
			sb.Children.Add(animation);
			Storyboard.SetTargetName(animation, fadeOutPanel.Name);
			Storyboard.SetTargetProperty(animation, new PropertyPath(Panel.OpacityProperty));
			sb.Completed += new EventHandler(sb_bringOutCompleted);
			sb.Begin(fadeOutPanel);
		}
[+][-]06/22/09 06:03 AM, ID: 24681938Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: WPF and Silverlight
Tags: banner ticker marquee scroll animation smooth fast
Sign Up Now!
Solution Provided By: inspire-it
Participating Experts: 1
Solution Grade: A
 
[+][-]06/18/09 07:00 PM, ID: 24663313Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625