Fading in and out.

M

Mr. Magic

I've got various file types (.pdf, .swf, .jpg, .html) that I need to display
to the user. After a timer fires, I need to fade the current file out and
fade in the next one.

Does anybody know of any libraries that will do this? I assume I'll have to
put the file viewer into some kind of container that will then handle the
transition.

TIA - Jeff.
 
P

Peter Duniho

Mr. Magic said:
I've got various file types (.pdf, .swf, .jpg, .html) that I need to
display to the user. After a timer fires, I need to fade the current
file out and fade in the next one.

Does anybody know of any libraries that will do this? I assume I'll have
to put the file viewer into some kind of container that will then handle
the transition.

It depends on how you are displaying them. But it's relatively simple
to do in a Forms application by explicitly compositing your images with
alpha blending before displaying them (doing so iteratively, of course,
adjusting each image's alpha for the composition to cause the fade effect).

And while I don't know the specifics, my understanding is that WPF has
an animation API that will do this even more automatically for you.

Pete
 
J

Jackie

Yes WPF will do it automatically but I need to do it in WinForms.

Jeff.

If you want semi-transparency, you'll need to look at "layered windows":
http://msdn.microsoft.com/en-us/library/ms997507.aspx
There's also an example function there called FadeRect at the bottom.
However, this only works for top-level windows (not child windows, the
controls you have on your window).
If you can somehow put the controls you want on a new layered window and
position it on your main window, you can apply semi-transparency on the it.
 
M

Matt

Yes WPF will do it automatically but I need to do it in WinForms.

Jeff.

Check out codeproject.com, and enter "fade image" into the search box.
I found several, not sure which one is most appropriate for your use.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top