473,387 Members | 1,529 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,387 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 13893
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.