473,231 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Animation for wait dialog

Most applications, including Windows Explorer, show some sort of
'wait' dialog with animation when a lengthy operation is going on. For
example, When the Windows Explorer is searching for something, it
shows a small dialog with a moving flashlight. I examined the
explorer.exe and found that that was an avi file.

Now that, I would like to do similar thing in my C# application. But
what is the most efficient way to do so?
1)Manually drawing animations on a form using .NET GDI+ methods :
could reduce resource usage.
2)Using animated GIF file : only requires a PictureBox
3)Using an avi file on a media player : high quality but it would take
a lot of time to load the media player, and a lot of resources.

I can't decide what is the best practice. Maybe all three schemes I'd
come up with are all wrong. Thank you for any advice.
Jul 5 '08 #1
4 13888
On Sat, 05 Jul 2008 06:53:13 -0700, Sin Jeong-hun <ty*******@gmail.com>
wrote:
Most applications, including Windows Explorer, show some sort of
'wait' dialog with animation when a lengthy operation is going on. For
example, When the Windows Explorer is searching for something, it
shows a small dialog with a moving flashlight. I examined the
explorer.exe and found that that was an avi file.

Now that, I would like to do similar thing in my C# application. But
what is the most efficient way to do so?
Define "efficient".

I'm pleasantly surprised to hear that the PictureBox control class
supports animated GIFs. I'd never tried that before, and I've seen other
areas of .NET where that level of functionality is "left as an exercise
for the reader". :) If you can get PictureBox to animate an animated
GIF, IMHO that's the best way to do it.

I doubt Windows Explorer actually loads the entire Windows Media Player
just to show the AVI you say it's using for its animation, so were you to
use an AVI, you'd either need to figure out the most lightweight way of
showing the AVI, or suffer a cost much greater than Windows Explorer does
for displaying. I don't know what you mean by "high quality"; an animated
GIF and a lossless-compressed AVI should be identical in quality.

The PictureBox approach requires the least amount of work, by _far_, and I
would be surprised if there's enough extra overhead to make it worth you
going to all the effort to implement the same functionality yourself. To
me, that makes it the obvious way to go.

Pete
Jul 5 '08 #2
On Jul 6, 1:25*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sat, 05 Jul 2008 06:53:13 -0700, Sin Jeong-hun <typing...@gmail.com*
wrote:
Most applications, including Windows Explorer, show some sort of
'wait' dialog with animation when a lengthy operation is going on. For
example, When the Windows Explorer is searching for something, it
shows a small dialog with a moving flashlight. I examined the
explorer.exe and found that that was an avi file.
Now that, I would like to do similar thing in my C# application. But
what is the most efficient way to do so?

Define "efficient".

I'm pleasantly surprised to hear that the PictureBox control class *
supports animated GIFs. *I'd never tried that before, and I've seen other *
areas of .NET where that level of functionality is "left as an exercise *
for the reader". *:) *If you can get PictureBox to animate an animated *
GIF, IMHO that's the best way to do it.

I doubt Windows Explorer actually loads the entire Windows Media Player *
just to show the AVI you say it's using for its animation, so were you to*
use an AVI, you'd either need to figure out the most lightweight way of *
showing the AVI, or suffer a cost much greater than Windows Explorer does*
for displaying. *I don't know what you mean by "high quality"; an animated *
GIF and a lossless-compressed AVI should be identical in quality.

The PictureBox approach requires the least amount of work, by _far_, and I *
would be surprised if there's enough extra overhead to make it worth you *
going to all the effort to implement the same functionality yourself. *To *
me, that makes it the obvious way to go.

Pete
By "efficient" I mean less time to start the animation, and less
memory & CPU consumptions.
PictureBox does support animated GIFs but as you may know, GIF only
supports 256 colors. So it can't display soft true color animation.
I'm not sure but I think that avi embedded in the Windows Explorer
isn't like those you see on the Internet. I guess it's an uncompressed
avi that can be played by Windows API somehow, like BMP.
By "high quality" I mean high quality true color animation. For
example, the file copy dialog of Windows Vista shows very soft
animations. To show that quality animation to users, I wonder what
would professional C# developers do. That's why posted this. Using
Managed DirectX is also a good option?
Jul 5 '08 #3
On Sat, 05 Jul 2008 10:07:24 -0700, Sin Jeong-hun <ty*******@gmail.com>
wrote:
By "efficient" I mean less time to start the animation, and less
memory & CPU consumptions.
Well, an animated GIF is the best choice there. There's a direct
correlation between video quality and computational cost, in terms of both
the size of the code that has to be loaded and the amount of work it has
to do.
PictureBox does support animated GIFs but as you may know, GIF only
supports 256 colors. So it can't display soft true color animation.
That's true. But for better or worse, I don't think that on Windows,
people really expect 24-bit UI animations. :) I would actually expect a
256-bit GIF to be sufficient.
I'm not sure but I think that avi embedded in the Windows Explorer
isn't like those you see on the Internet. I guess it's an uncompressed
avi that can be played by Windows API somehow, like BMP.
Well, AVI is just a container format, actually. It's just a specialized
RIFF format. You'd have to look at the exact format to know exactly what
they're doing, but there are plenty of lossless video formats that can be
stored as AVI, including 24 bpp video.
By "high quality" I mean high quality true color animation. For
example, the file copy dialog of Windows Vista shows very soft
animations. To show that quality animation to users, I wonder what
would professional C# developers do. That's why posted this. Using
Managed DirectX is also a good option?
I haven't used Vista enough to have a good idea of what you're talking
about. The animations I see on XP would be fine as 8-bit. :)

As far as Managed DirectX, sure...that may in fact do very well for you.
Look at the AudioVideoPlayback class for a very easy-to-use video playback
component. At the very least, I think it should load faster than WMP. :)

Pete
Jul 6 '08 #4

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Sat, 05 Jul 2008 10:07:24 -0700, Sin Jeong-hun <ty*******@gmail.com>
wrote:
>By "efficient" I mean less time to start the animation, and less
memory & CPU consumptions.

Well, an animated GIF is the best choice there. There's a direct
correlation between video quality and computational cost, in terms of both
the size of the code that has to be loaded and the amount of work it has
to do.
>PictureBox does support animated GIFs but as you may know, GIF only
supports 256 colors. So it can't display soft true color animation.

That's true. But for better or worse, I don't think that on Windows,
people really expect 24-bit UI animations. :) I would actually expect a
256-bit GIF to be sufficient.
>I'm not sure but I think that avi embedded in the Windows Explorer
isn't like those you see on the Internet. I guess it's an uncompressed
avi that can be played by Windows API somehow, like BMP.

Well, AVI is just a container format, actually. It's just a specialized
RIFF format. You'd have to look at the exact format to know exactly what
they're doing, but there are plenty of lossless video formats that can be
stored as AVI, including 24 bpp video.
>By "high quality" I mean high quality true color animation. For
example, the file copy dialog of Windows Vista shows very soft
animations. To show that quality animation to users, I wonder what
would professional C# developers do. That's why posted this. Using
Managed DirectX is also a good option?

I haven't used Vista enough to have a good idea of what you're talking
about. The animations I see on XP would be fine as 8-bit. :)

As far as Managed DirectX, sure...that may in fact do very well for you.
Look at the AudioVideoPlayback class for a very easy-to-use video playback
component. At the very least, I think it should load faster than WMP. :)

Pete

Windows (XP) uses a native control called the Animation Control Library
(msdn: http://msdn.microsoft.com/en-us/libr...84(VS.85).aspx)
There is a great C# implementation available here:
http://www.codeproject.com/KB/miscctrl/CGAnimation.aspx
There are several limitations to the avi file format, see the msdn
documentation for full details:
An animation control can display an AVI clip originating from either an
uncompressed AVI file or from an AVI file that was compressed using
run-length (BI_RLE8) encoding. You can add the AVI clip to your application
as an AVI resource, or the clip can accompany your application as a separate
AVI file.

Note The AVI file, or resource, must not have a sound channel. The
capabilities of the animation control are very limited and are subject to
change.
The UI thread is running the animation so any work that you want to do while
'playing' the animation must happen in another thread. (e.g. using the
Backgroundworker control or Ascyn webservice calls).
I'm still looking for a tool that can compress the avi file.

Rudi
Jul 18 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: metsymani | last post by:
In my web application, I have a search screen coded in ASP.Net. The Search process takes lot of time. So, I need to show a wait page informing the user that "Search is in progress. Please wait" along...
6
by: Ollie | last post by:
I have a web app that converts files. The conversion can take up to 20 minutes depending on the file size and contents. So, to help the user I want to display an animation (gif/avi/swf) while...
6
by: Jeremy Chapman | last post by:
I have a button on my page which when clicked redirects to another page. on the page load of the page that I've redirected to, there is a long query. What I want to do is with dhtml, display test...
15
by: Agnes | last post by:
As the user click 'save' , i want to show a little prompt' Record is saved" (for 1-2 secs) , then it will closed automically, In my previous vfp application, there is a function "wait window" ....
2
by: quickcur | last post by:
Hi, I have a html which have a <imgtag. Since it takes quite some time to download the image when user visit the page, I would like to show a small animation at the same location of the...
0
by: AMDRIT | last post by:
Hello Everyone, Just curious how far off the mark I am with my Working Dialog. Any improvements are welcomed. Scenario, we have an application (vb'05) that at known times performs tasks that...
3
by: oopaevah | last post by:
I want to have a separate button which invokes the "browse" button on an input type=file. In internet explorer the following code works ok, in firefox nothing happens. All I do is call click()...
0
by: Jack Javascript | last post by:
I created a sliding div animation that is toggled by clicking a link. The div starts in a hidden state, and slides slowly open the first time the link is clicked. The second click hides the div...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.