Help with image effect

MisterX b.xavier at internet.lu
Mon Oct 24 01:04:13 EDT 2005


Alex, 

Great effect!!!

Strange, my portable PC 1.6Ghz is faster than my 3Ghz PC ;)

3Ghz = smooth transition
1.6Ghz = instantaneous...

what you could do is test the function to see how much time it takes.
Given that, increment or decrement the number of transitions...

Also a percentage increase in size may look smoother but that's just
a habit and it may slow down things...

Last bit, that would be cool, is to switch layers so that the zoomed
image becomes the top image in the middle of the transition ;)

cheers
Xavier

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Alex Tweedly
> Sent: Sunday, October 23, 2005 8:51 PM
> To: How to use Revolution
> Subject: Help with image effect
> 
> 
> I want a nice, simple (?) visual effect:
> 
>  I have two images (which may be different sizes), and I want 
> to swap them over (such that each one stretches or shrinks to 
> occupy the space previously taken up by the other one).
> 
> I thought this would be simple ... loop some number of times, 
> adjusting the "rect" of each image - then find a suitable 
> "wait" value to slow it down.
> 
> In fact, it is unbearably slow - even for medium sized images 
> (320*240 swapping with a 320*480) each step is clearly visible.
> For 2 images of 160*120 it's almost a smooth animation - I'm 
> not sure if it's just that they are smaller sizes, or if it's 
> the fact that the sizes remain the same.  (all on medium 
> laptop - Pentium P4 2.8G with low-end ATI graphics)
> 
> It does look OK on a top of the range Pentium laptop with 
> ATI92xx graphics (my wife needs high-end hardware to play 
> Sims :-), but that's not exactly typical hardware yet.
> 
> Is there some other way I should be approaching this ?
> 
> > on imageSwap pImg1, pImg2, pNumber
> >   local r1, r2
> >   local dtlx, dtly, dbrx, dbry
> >  
> >   if paramCount() < 3 then
> >     put 20 into pNumber
> >   end if
> >  
> >   put the rect of img pImg1 into r1
> >   put the rect of img pImg2 into r2
> >    
> >   put (item 1 of r2 - item 1 of r1)/20 into dtlx
> >   put (item 2 of r2 - item 2 of r1)/20 into dtly
> >   put (item 3 of r2 - item 3 of r1)/20 into dbrx
> >   put (item 4 of r2 - item 4 of r1)/20 into dbry
> >    
> >   repeat with i = 1 to pNumber
> >     set the rect of img pImg1 to trunc(item 1 of r1 + i*dtlx), 
> > trunc(item 2 of r1 + i*dtly), trunc(item 3 of r1 + i*dbrx), 
> trunc(item
> > 4 of r1 + i*dbry)
> >     set the rect of img pImg2 to trunc(item 1 of r2 - i*dtlx), 
> > trunc(item 2 of r2 - i*dtly), trunc(item 3 of r2 - i*dbrx), 
> trunc(item
> > 4 of r2 - i*dbry)
> >   end repeat
> > end imageSwap
> 
> Thanks,
> 
> -- 
> Alex Tweedly       http://www.tweedly.net
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.361 / Virus Database: 267.12.4/146 - Release 
> Date: 21/10/2005
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage 
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list