On Jun 12, 2006, at 06:49 UTC, Emile Schwarz wrote:
> > For IndexY = 0 To SourceH
> > For IndexX = 0 To SourceW
> > [same reason as putting the Y loop outside, memory caching]
>
> Isn't it what I already wrote ?
No, your code was looping the other way, SourceH DownTo 0. It's possible you
would get a slight boost iterating forwards, as shown above, but I doubt that
would be measurable.
> > If UserCancelled Then Exit // Avoid any Infinite Loop
> > is placed outside both loops ==> will never be called...
>
> I am not sure if I understand correctly Joe S. on this one, but... it
> works ! (or I was dreaming...)
You did not understand me correctly, and if you think this works, you must be
dreaming. :) Your code checks UserCancelled outside BOTH loops, i.e., after
the whole process is done anyway. Not much point in that.
> It was originally in the loop (one for the X, one for the Y)...
Yes, that was the problem. You don't need it inside both loops; even if you
wanted to check on every pixel -- which is a horrible idea -- you'd only need
it inside the inner one.
But what you should do instead is check it just once for each row, i.e., put it
only in the outer loop. The end of your loops might look something like:
Next X
If UserCancelled Then Exit
Next Y
This way, it's checked once per row, which is 2675 times faster (if each row is
2675 pixels wide).
> Anyway, if I understand incorrectly, I will put it back in the loop
> (where I always put it previously).
No, please don't do that. :)
Best,
- Joe
--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC "Making the Internet a Better Place"
http://www.verex.com/
_______________________________________________
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>