Click here to Skip to main content
15,898,681 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I would like to find out if anybody knows how to create a control that enables a user to view pictures, album art, etc.
I want it to work with a drag-drop kind of event.

After searching the web I have only found a control created with Flash, "iTunes Cover Flow" on http://www.weberdesignlabs.com/blog/2007/09/flash-itunes-cover-flow[^]

Thanks...
Posted
Updated 2-Jun-11 6:11am
v2

Have a look at this WPF control:

http://www.codeproject.com/Catalogs/3590/WPF-Coverflow-by-Mindscape.aspx[^]

Click the image, it will take you to the relevant website where you should be able to download their control library. Not used it myself, but it looks good :)

If you're looking to do this on the web, it can only be done in flash ;P

Hope this helps,

Ed
 
Share this answer
 
v3
Comments
BobJanova 2-Jun-11 12:42pm    
Surely, if it works in WPF, it should work in Silverlight, too?
Ed Nutting 2-Jun-11 12:46pm    
Yes, but then Silverlight is pretty much useless as most computers in the world don't support it, note Apple will never support it as it is a Microsoft technology. At least at the moment Flash works with some Apple hardware. So far as I can see, Sliverlight is one of those 'failed to take off' technologies from Microsoft that would be good, but it isn't widely enough supported to be worthwhile using.
Thanks for the help.
I also found a link to some useful source code, for anybody that wants to use OverFlow.

using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;
using Balder.Core.Math;
namespace Coverflow{
  public partial class CoverFlow : UserControl
  {
    public static DependencyProperty CoverProperty =
      DependencyProperty.Register("Cover", typeof(double), typeof(CoverFlow), new PropertyMetadata(0d, new PropertyChangedCallback(OnCoverChanged)));

    public const double CameraYPos = 0;
    public const double CameraZPos = 100;
    public const double CoverSpace = 5d;
    public const double CoverChangeDuration = 500d;
    public const double CurrentCoverOpeningSpace = 5d;
    private List<Cover> _covers;
    private int _currentCoverIndex;
    private Storyboard _coverStoryboard;
    private DoubleAnimation _coverAnimation;

    public CoverFlow()
    {
      InitializeComponent();
      this._covers = new List<Cover>();
      this._camera.Position = new Vector(0, CameraYPos, CameraZPos);
      this._coverStoryboard = new Storyboard();
      this._coverAnimation = new DoubleAnimation();
      this._coverAnimation.Duration = TimeSpan.FromMilliseconds(CoverChangeDuration);
      this._coverStoryboard.Children.Add(this._coverAnimation);
      Storyboard.SetTarget(this._coverAnimation, this);
      Storyboard.SetTargetProperty(this._coverAnimation, new PropertyPath("(CoverFlow.Cover)"));
    }
    public void AddCover()
    {
      double coverPos = ((double)this._covers.Count) * CoverSpace;
      Cover cover = new Cover();
      this._covers.Add(cover);
      this._viewport.Children.Add(cover);
      cover.Position = new Vector(coverPos, 0, 0);
      this.Update();
    }
    public void Update()
    {
      int index = 0;
      foreach (var cover in this._covers)
      {
        if (index == this._currentCoverIndex)
        {
          cover.MoveToFront();
        }
        else if (index < this._currentCoverIndex)
        {
          cover.MoveToLeft();
        }
        else
        {
          cover.MoveToRight();
        }
        index++;
      }
    }
    private int CurrentCoverIndex
    {
      get
      {
        return this._currentCoverIndex;
      }
      set
      {
        this._currentCoverIndex = value;
        this.Update();
      }
    }
    public double Cover
    {
      get
      {
        return (double)this.GetValue(CoverProperty);
      }
      set
      {
        this.SetValue(CoverProperty, value);
      }
    }

    public static void OnCoverChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
    {
      CoverFlow coverFlow = (CoverFlow)obj;

      coverFlow.CurrentCoverIndex = Convert.ToInt32(e.NewValue);
      var currentCover = ((double)e.NewValue);


      double xpos = ((double)e.NewValue) * CoverSpace;
      coverFlow._camera.Target = new Vector(xpos, 0, 0);
      coverFlow._camera.Position = new Vector(xpos, CameraYPos, CameraZPos);
      coverFlow.Cover = (double)e.NewValue;
    }
    public int CurrentlyBeingMovedTo
    {
      get; private set;
    }
    public void MoveTo(int cover)
    {
      this.CurrentlyBeingMovedTo = cover;
      this._coverAnimation.To = (double)cover;
      this._coverStoryboard.Begin();
    }
    public void MoveNext()
    {
      int next = this.CurrentlyBeingMovedTo + 1;
      if( next >= this._covers.Count )
      {
        next = this._covers.Count - 1;
      }
      this.MoveTo(next);
    }
    public void MovePrevious()
    {
      int next = this.CurrentlyBeingMovedTo - 1;
      if( next < 0 )
      {
        next = 0;
      }
      this.MoveTo(next);
    }
  }
}


Thanks again.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900