Scrollable Album art (User control)

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 6
Reputation: thegrovesy is an unknown quantity at this point 
Solved Threads: 0
thegrovesy thegrovesy is offline Offline
Newbie Poster

Scrollable Album art (User control)

 
0
  #1
Apr 15th, 2009
Hi, I now have the back end of a music library application and I am now working on the GUI side.

I would like to display all the albums (Album cover art, Title and Artist) in a scrollable area, and would like some advice on how to do this:

Firstly is it a good idea to create a user control for each album? I knocked one together which is basically made up of a picture box (for the album art) and two labels underneath (for the title and artist). The plan was to place them on a panel and allow the user to scroll along them (in a grid view style). I got this working with a mock up using a button on the panel and got code working so you could "flick" the button left and right, but as soon as I added a large number of buttons (100) it became pretty much unusably slow! (I was using the Button1.Left property to move each button)
  • Can someone suggest a better way of doing this?
  • Is my custom control a good idea?
  • Will I need to create a custom version of the Panel (or similar) to get a better "smooth" scroll?
  • I assume for optimization I will only want to load the album art just before it comes into view, and unload it once it leaves view? (I currently have about 400 albums)
  • Maybe I was just being unrealistic using 100 buttons as a test, as in the actual GUI I guess there will only ever be about 20-30 albums on the screen at once!
  • Should I use a separate thread for loading the album arts?

I'm pretty stuck on what to try/do next so any help/pointers would be greatly appreciated.

Cheers
Last edited by thegrovesy; Apr 15th, 2009 at 10:33 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,908
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 274
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: Scrollable Album art (User control)

 
0
  #2
Apr 15th, 2009
Your custom control seems to be a good idea to me.
I made something similar for the table of Mendeleev(chemical elements).
>Will I need to create a custom version of the Panel (or similar) to get a better "smooth" scroll?
There is already a custom version in the form of a FlowLayout panel.
Watch this video : http://msdn.microsoft.com/nl-be/vcsh...28(en-us).aspx
Sorry, with your other points I don't have that much experience.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 6
Reputation: thegrovesy is an unknown quantity at this point 
Solved Threads: 0
thegrovesy thegrovesy is offline Offline
Newbie Poster

Re: Scrollable Album art (User control)

 
0
  #3
Apr 15th, 2009
Cheers ddanbe, I'll check it out when I get home tonight. Much appreciated
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 6
Reputation: thegrovesy is an unknown quantity at this point 
Solved Threads: 0
thegrovesy thegrovesy is offline Offline
Newbie Poster

Re: Scrollable Album art (User control)

 
0
  #4
Apr 16th, 2009
Had a play with the FlowLayoutPanel last night and might do what I want. However I am having trouble getting it to scroll smoothly with the MouseMove event.

What I am doing is allowing the user to click/hold the panel then drag the mouse left/right to scroll along its contents. It also allows the user to Click/Hold/flick/release (if that makes sense) so that the contents is thrown and eventually slows down to a stop (iPhone style).

This same code worked well when I just had one button on a standard panel, but when I do it on this FlowLayoutPanel the dragging makes the contents very jittery!!! I have attached the test project for anyone wanting to see what I mean.

Also, I really want to remove the horizontal scrollbar, as the user will obviously be using the above method to scroll its contents.

Finally, I don't believe the problem is due to the number of controls I have added to the FlowLayoutPanel (400) as you can reduce this to a much smaller number (30) and the same problem happens.

Any ideas?
Attached Files
File Type: zip ScrollControlTest.zip (60.6 KB, 15 views)
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,908
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 274
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: Scrollable Album art (User control)

 
0
  #5
Apr 16th, 2009
Once I made a clock control (pity I lost the code )
My clock was also flickering.
I used double buffering as a remedy.
It might help with your problem.
This is to get you started: http://msdn.microsoft.com/en-us/library/ms229622.aspx

EDIT: btw could not open your zip file for some strange reason...
Last edited by ddanbe; Apr 16th, 2009 at 3:10 pm.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 6
Reputation: thegrovesy is an unknown quantity at this point 
Solved Threads: 0
thegrovesy thegrovesy is offline Offline
Newbie Poster

Re: Scrollable Album art (User control)

 
0
  #6
Apr 17th, 2009
Hummm double buffering didn't fix it, it doesn't actually look like a buffer issue anyway as it looks more like its jumping back and forth! Not sure why the zip didn't work, i could extract it from my computer! I have attached a new .zip of the project which I did on a different PC. Thanks
Attached Files
File Type: zip ScrollControlTest.zip (62.0 KB, 11 views)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC