Solved

animated bmp slow... should I use threads?

Posted on 2004-08-13
4
194 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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