Solved

animated bmp slow... should I use threads?

Posted on 2004-08-13
4
190 Views
Last Modified: 2010-04-05
I've got an animated BMP list (its a jedi component) and it runs at the top of an upload page I have.   I'm using indy.  first http then ftp.   I have an antifreeze component in there as well.    When the uploading begins / progresses  the animation will become sticky and start / stop a lot.    This looks silly and I know there must be an answer.   Can you make a suggestion?


Thanks!
0
Comment
Question by:hibbidiji
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 11799179
you could try making your animation in a thread that should solve the problrm. But you could also put your uploading procedure in a thread.
Try them both to see which is the best
0
 
LVL 17

Accepted Solution

by:
geobul earned 500 total points
ID: 11799396
Hi,

IMHO it would be better to put the uploading in a thread not the animation. If uploading is in the main thread and the animation is in a separate thread then animation will be slower than now (both in one thread) I think. The reason is that only the main thread can show visual components.

Regards, Geo
0
 
LVL 2

Expert Comment

by:Molando
ID: 11800902
Not completely sure what you are saying. if you are creating a webpage that has an upload section, and the animation on the web page starts and stops a lot. then turn the images into an animated gif. the webbrowser viewing your page will then display it fine.

If it is an application you are workign with, then you will need to go with threads. With threads , ask yourself is the task going to be independant of whatever else they are doing. In your example if they are also going to be allowed to do other things when they are uploading, then the uploading should go into a different thread.

Threads can be a bit of a pain, as if you need to access the screen, you need either to send a message from your thread to your main thread(app), or to syncronize. All syncronize is is run the procedure syncronized in the main thread.
Ok, now in English. if you are going to be doing something graphical, do not do it in a thread.

If I was doing this, I would place the upload functionality into a thread. and have that thread send a message back say every 5% processed (or so many seconds) to the main app to update your progress bar.
I would turn your bmp list into an animation. Apart from then being able to use any media playing component, the animation should be smaller. If you wanted to do the animation yourself, then just use a timer, which displays the next bmp image in a TImage component. Have some global integer to keep count of the last image you displayed. what is nice with this is that you can start and stop your timer at will. You did not say how large your image was. if you do get any flicker. then try form1.doublebuffered := true.

Molando
0
 
LVL 1

Author Comment

by:hibbidiji
ID: 11807770
well.   I'll be frank, I dont like the answers but thats because it means work for me, not due to any lack of quality in the answers.   THanks guys.  I will go from here
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi component that can load a DLL in design time? 8 93
Delphi - replicating a form 8 93
MS Access from Delphi 31 81
Can Live bindings change TGrid Cell Colour ? 1 35
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question