Hi All,
The last few months I have been working on a personal movie/streaming app. One of my goals was to have a sliding animation effect to cycle through my movie collection...pretty much just like how you cycle (left/right and also up/down) through movies on the Netflix app and also similar to firestick home screen. My idea was sliding panels(filled with buttons and pictureboxes for the movie posters) along the x/y axis, the data for each movie would come from my media server where the movies and mysql db are. You might have seen a lot of my questions here. Lots of you helped me learn a lot including both Bruces and cogier. Cogier even gave me a nice snippet of code for sliding panels. I integrated that into my app but unforunately it didn't mesh well. The panels moved really really slow and it was just unusable. That form did have a lot going on but it made me think that a lot of sliding panels on the x/y axis wasn't the solution. If panels aren't the solution, could someone suggest another direction to go to accomplish this? I was thinking maybe Drawingarea might work? I'm unfamiliar working with Drawingarea so I'm spending today looking for more info and examples.
sliding animations
- BruceSteers
- Legend
- Posts: 2145
- Joined: Thu Jul 23, 2020 5:20 pm
- Location: Isle of Wight
Re: sliding animations
Maybe a ScrollView with Alignment = Align.Horizontal.
you could hide the scrollbar
add buttons to scroll manually a few images.
you could hide the scrollbar
add buttons to scroll manually a few images.
Re: sliding animations
I think I had a scrollview experiment project at one point. Must have abandoned it but I'll see if I can find it and try again. Thanks Bruce!BruceSteers wrote: ↑Wed May 07, 2025 6:46 pm Maybe a ScrollView with Alignment = Align.Horizontal.
you could hide the scrollbar
add buttons to scroll manually a few images.
Re: sliding animations
I found the scrollview project and I see why I abandoned it. I used scrollview1.scrollX = 25 or whatever number. It just jumps that distance, it doesn't slide in a slight animated way. Also, the items I put inside the panels (picturebox and button) behave differently than if that panel was inside another panel instead of the scrollview its in. I don't think scrollview is the answer either. I will keep experimenting with different things.rj71 wrote: ↑Wed May 07, 2025 8:30 pmI think I had a scrollview experiment project at one point. Must have abandoned it but I'll see if I can find it and try again. Thanks Bruce!BruceSteers wrote: ↑Wed May 07, 2025 6:46 pm Maybe a ScrollView with Alignment = Align.Horizontal.
you could hide the scrollbar
add buttons to scroll manually a few images.
- BruceSteers
- Legend
- Posts: 2145
- Joined: Thu Jul 23, 2020 5:20 pm
- Location: Isle of Wight
Re: sliding animations
well yeah, there is not a default or built in animation method.
you'll have to program a simple one.
add more frames and less distance to make it smoother.
you'll have to program a simple one.
For c As Integer = 1 To 5 ' Adjust for more "frames"
scrollview1.scrollX +=5 ' Adjust for speed
Wait 0.01 ' Adjust for speed (try without Wait if too slow)
Next
add more frames and less distance to make it smoother.
Re: sliding animations
I'll give that a try. Thanks Bruce.BruceSteers wrote: ↑Thu May 08, 2025 10:22 pm well yeah, there is not a default or built in animation method.
you'll have to program a simple one.
For c As Integer = 1 To 5 ' Adjust for more "frames" scrollview1.scrollX +=5 ' Adjust for speed Wait 0.01 ' Adjust for speed (try without Wait if too slow) Next
add more frames and less distance to make it smoother.
- BruceSteers
- Legend
- Posts: 2145
- Joined: Thu Jul 23, 2020 5:20 pm
- Location: Isle of Wight
Re: sliding animations
This worked okay for me...
I uploaded a video clip..
https://www.youtube.com/shorts/LEDDn-Fe ... ture=share
Public Sub ButtonGoLeft_Click()
Dim w As Integer = ScrollView1.W - Desktop.Scale
Dim iCount As Integer
Do
ScrollView1.ScrollX -= 1
iCount += 1
If iCount >= W Or If ScrollView1.ScrollX = 0 Then Break
Wait 0.001
Loop
End
Public Sub ButtonGoRight_Click()
Dim w As Integer = ScrollView1.W - Desktop.Scale
Dim iCount As Integer
Do
ScrollView1.ScrollX += 1
iCount += 1
If iCount >= W Or If ScrollView1.ScrollX >= ScrollView1.ContentsWidth - ScrollView1.ClientW Then Break
Wait 0.001
Loop
End
I uploaded a video clip..
https://www.youtube.com/shorts/LEDDn-Fe ... ture=share
Re: sliding animations
Wow that looks great. Thanks Bruce. This is what I am looking for I think. I will see if I can get it integrated with the movie data that is fetched from the server and then into the main app.BruceSteers wrote: ↑Fri May 09, 2025 8:20 am This worked okay for me...
Public Sub ButtonGoLeft_Click() Dim w As Integer = ScrollView1.W - Desktop.Scale Dim iCount As Integer Do ScrollView1.ScrollX -= 1 iCount += 1 If iCount >= W Or If ScrollView1.ScrollX = 0 Then Break Wait 0.001 Loop End Public Sub ButtonGoRight_Click() Dim w As Integer = ScrollView1.W - Desktop.Scale Dim iCount As Integer Do ScrollView1.ScrollX += 1 iCount += 1 If iCount >= W Or If ScrollView1.ScrollX >= ScrollView1.ContentsWidth - ScrollView1.ClientW Then Break Wait 0.001 Loop End
I uploaded a video clip..
https://www.youtube.com/shorts/LEDDn-Fe ... ture=share
Re: sliding animations
Hey Bruce, I appreciate the help but I can't get that code to work the way I need it to. I am going to revisit the sliding panels because it is the closest I have got to achieving my goal. I am working on a sample project that I'll attach to this thread when it's ready. That project has cogier's code that I chopped up a little. I will just have to somehow deal with the slowness when integrating into the main app.
Re: sliding animations
I have attached a project that I have been working on. I apologize for some of the sloppy code, I am NOT a professional programmer and I have been distracted by other life things. So here's the breakdown of this test project:
Form1 - experimenting with dynamic panel creation (thanks again BruceSteers!) with pictureboxes and buttons inside of those. It won't work for you because it is hitting my media server for data and of course my server is not open to the internet. Still working on that and I am not really sure if I will integrate it into the sliding panels. You can sort of see how I'm grabbing data from the server if you're interested.
Form2 - This started with 3 panels that could individually go left/right but an up/down motion moved all 3 panels at the same time. This is what made it slow. I stopped working on Form2 when I had an ipiphany and created Form3 to start over.
Form3 - The idea hit me that I should just put those 3 panels in another container panel and just move that container up/down. Not sure why I didn't think of that sooner. That right there seems to have solved the slowness problem.
I am making progress and I think I'm on the right track but I have several issues that I would appreciate advice on. Read the textarea on form3. I think that lists all the issues.
I'm using cogier's code where he simplified moving along the x/y axis and reduced the amount of code by a huge amount. Thanks cogier!
Form1 - experimenting with dynamic panel creation (thanks again BruceSteers!) with pictureboxes and buttons inside of those. It won't work for you because it is hitting my media server for data and of course my server is not open to the internet. Still working on that and I am not really sure if I will integrate it into the sliding panels. You can sort of see how I'm grabbing data from the server if you're interested.
Form2 - This started with 3 panels that could individually go left/right but an up/down motion moved all 3 panels at the same time. This is what made it slow. I stopped working on Form2 when I had an ipiphany and created Form3 to start over.
Form3 - The idea hit me that I should just put those 3 panels in another container panel and just move that container up/down. Not sure why I didn't think of that sooner. That right there seems to have solved the slowness problem.
I am making progress and I think I'm on the right track but I have several issues that I would appreciate advice on. Read the textarea on form3. I think that lists all the issues.
I'm using cogier's code where he simplified moving along the x/y axis and reduced the amount of code by a huge amount. Thanks cogier!
You do not have the required permissions to view the files attached to this post.