Picture transitions

TonnyVanmunster

Member
Licensed User
Hi,

I'm quite new to this forum but I like it a lot. I'm working on a small project in Basic4PPC and have a question related to picture/photo animations.

'd like to load a first picture. Then, when sliding from right to left with my finger over the picture, the picture should gradually move to the left of the screen, while a newer picture gradually becomes visible. After a second or so, the first picture should be gone, and the new one should be all visible.

Is there an easy way to create this "transition-between-pictures" behaviour using any of the Basic4PPC libraries ? An actual code snippet would be great !

Thanks !
 

derez

Expert
Licensed User
Longtime User
Try the code below and play with the parameters, it is not actually fluent but moves.
Create the following controls: image1 (with an image, select stretched option), button1 and timer1.

B4X:
Sub Globals
   'Declare the global variables here.
count = 0
End Sub

Sub App_Start
   Form1.Show
   timer1.Interval = 100
   timer1.Enabled = False
End Sub


Sub Button1_Click
timer1.Enabled = True
End Sub

Sub Timer1_Tick
image1.Left = image1.Left - 3
image1.Top = image1.Top -3
image1.Width = image1.Width * 0.9
image1.Height = image1.Height * 0.9
count = count + 1
If count = 30 Then timer1.Enabled = False
End Sub
 

agraham

Expert
Licensed User
Longtime User

TonnyVanmunster

Member
Licensed User
PushTop and PushBottom in ImageLibEx ?

One more question on ImageLibEx : there are PushRight and PushLeft methods, but apparently no PushTop and PushBottom methods. Are those extensions still planned ?

Best regards,
Tonny
 

agraham

Expert
Licensed User
Longtime User
Are those extensions still planned ?
Still? I don't think I have indicated anywhere that I was considering this. No, I am not planning to add anything to this library at the moment. I'll make a note to consider this if/when I need to revisit the code.
 
Top