realbasic-nug
[Top] [All Lists]

Re: Reversing an image

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Reversing an image
From: "Theodore H. Smith" <delete at elfdata dot com>
Date: Fri, 30 Dec 2005 14:15:59 +0000
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20051230021806 dot 04F83F9BE45 at lists dot realsoftware dot com> <A81911A6-B133-4D27-B396-9B95E328F284 at farhner dot com> <1C95574E-B766-4462-B673-0672B3022169 at mobleybros dot com> <20051230134636 dot 6D31376C71 at isis dot visi dot com>

On 30 Dec 2005, at 13:46, Craig A. Finseth wrote:

        progress.prog.value=progress.prog.value+1

It's possible that an entire row would process in such a short time, that even doing it every row is too much.

I'd do it like this:

UpdateCount = UpdateCount + 1
if UpdateCount > 100 then // or some number, maybe not 100
  UpdateCount = 0
  if WaitUntil <= ticks then
    progress.prog.value= i / y * progress.prog.maximum
    Waituntil = ticks + 60 // updates once a second.
  end if
end if

Put that in the outer loop, and that'll save you a lot of time in doing your updates. The most frequent check, will be the integer check, which is very quick. then it does some stuff with a ticks() function which is not as quick but quicker than the UI. Then if both of those conditions pass, it goes through the UI.

Something like this, you can stuff into an intensive algorithm without really slowing it down noticably.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>