0

I implemented lightbox effect with window's opacity change whilst fading in/out. When I have my window maximized this effect has big delay or when I use duration property then opacity change is not smooth.

I manage this eg. with like here:

        DoubleAnimation animate = new DoubleAnimation();
        animate.From = 1.0;
        animate.To = 0.5;

        animate.Duration =  new Duration(TimeSpan.FromSeconds(0));
        this.BeginAnimation(Window.OpacityProperty, animate); // main window
        Window1 win = new Window1(); // new window to get focus
        win.ShowDialog();

Tell me please, if you know, does this effect works on GPU by default? If not, can I manage this somehow?

H.B.
  • 166,899
  • 29
  • 327
  • 400
galsan
  • 63
  • 10

1 Answers1

0

The maximization issue sounds like the computer might have performance issues, and the Duration issue exists because you set it to 0, a zero second animation is instant, of course it is not smooth.

H.B.
  • 166,899
  • 29
  • 327
  • 400
  • Yes but I wrote 'when I use duration'. Accidentally I pasted code with 0 value, but usually I use 0.5 - 1 second and it is not smooth. I also thought that might by performance issue so I asked about GPU.. About maximization the rule is that - bigger window -> slower / not smooth, smaller window (eg. 400x400) -> rather smooth. – galsan Aug 14 '11 at 07:38