Re: Component for showing animated GIFs or AVI



In article <memo.20080626140656.7592B@xxxxxxxxxxxxxxxxxxxxxxx>, Matthew Jones wrote:
Well, don't use that and use the other one suggested. I'm not sure what I'm missing
- why are you using the wrong one? Or did TGifImage get merged into Delphi?

From the helpfile:

There are several methods one can use to display a GIF:
---------------------
* Call the Draw or StretchDraw methods of a TCanvas object, passing a TGIFImage
object as a parameter.
* Load a GIF file into a TImage component and let the TImage component display the
GIF.
* Call the Paint method of TGIFimage to create a TGIFPainter thread object, passing
the destination canvas as a parameter.
---------------------

I made the second option. There are no Component which will be installed. And in
source I found this
----

REGISTER_TGIFIMAGE Define this symbol to register TGIFImage with
the TPicture class and integrate with TImage.
This is required to be able to display GIFs in
the TImage component.
The symbol is defined by default.
Undefine if you use another GIF library to
provide GIF support for TImage.
----

So I think it is ok to use a TImage which displays the GIF. Do you have a Component
TGifImage?

And now I found this comment at http://melander.dk/delphi/gifimage#faq_35

-------------
Thanks for this unit, anyway, I have a problem.
I intend to use TGIFImage for displaying progress bar (sort of) during query
execution. Now, since that query uses 100% of cpu, gif animation locks?
Is there a way to resolve this?
-------------

And the answer from Melander:

-----------------
I don't have an easy solution for you. I can only recommend that you execute the
query in a separate thread.

The reason the GIF animation (and every thing else for that matter) doesn't update
while your query is running, is that the main thread isn't processing any windows
messages.

TGIFImage used to be able to paint even though the main thread was blocked, but after
the I redesigned the GIF renderer that isn't possible anymore. Even the TAnimation
control doesn't paint asynchronously anymore - it just isn't safe.
------------------

Bad news.

Gruß aus den Bergen
Günter


.