PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Animation for wait dialog

 
 
Sin Jeong-hun
Guest
Posts: n/a
 
      5th Jul 2008
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.
 
Reply With Quote
 
 
 
 
Sin Jeong-hun
Guest
Posts: n/a
 
      5th Jul 2008
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?
 
Reply With Quote
 
Rudi Larno
Guest
Posts: n/a
 
      18th Jul 2008

"Peter Duniho" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Sat, 05 Jul 2008 10:07:24 -0700, Sin Jeong-hun <(E-Mail Removed)>
> 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/library/bb761884(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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel wait for Find Replace dialog box in Word JasonC Microsoft Excel Programming 4 24th May 2010 09:34 PM
Creating a please wait dialog Jeremy Chapman Microsoft ASP .NET 6 27th Sep 2006 11:24 PM
Wait while processing dialog boxes (threading?) Dustin Davis Microsoft VB .NET 3 1st May 2006 11:53 PM
Please Wait Dialog =?Utf-8?B?SmFrZQ==?= Microsoft Dot NET Framework Forms 1 15th Feb 2005 10:23 PM
long wait for Open file dialog to populate..... m miller Windows XP Help 4 8th Jan 2004 05:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:54 AM.