Drag and Drop for 360` Image animation


hi,

here code
xaml: 
<usercontrol x:class="moveimagetest360.page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
width="2000" height="112">
<canvas x:name="layoutroot" background="white">
<image x:name="myimage" source="team.jpg" width="2000" height="112" stretch="fill"
mouseleftbuttondown="thedragon_mouseleftbuttondown"
mouseleftbuttonup="thedragon_mouseleftbuttonup" mousemove="thedragon_mousemove">
</image>
</canvas>
</usercontrol>

c# code is: 
        bool isdragging = false;
        point offset;
        void thedragon_mouseleftbuttondown(object sender, mousebuttoneventargs e)
        {
            isdragging = true;
            myimage.capturemouse();
            offset = e.getposition(myimage);
        }
        void thedragon_mousemove(object sender, mouseeventargs e)
        {
            if (isdragging)
            {
                point newposition = e.getposition(layoutroot);
                myimage.setvalue(canvas.leftproperty, newposition.x - offset.x);
            }
        }
        void thedragon_mouseleftbuttonup(object sender, mousebuttoneventargs e)
        {
            if (isdragging)
            {
                isdragging = false;
                myimage.releasemousecapture();
            }
        }
 
here 1 big image of width 2000px dragged horizontally.

by using above code. get:

1.) when whole image dragged in 1 direction after end point  of image white space appears.

i need:

1.) if image dragged in left right direction , whole image dragged after image should start end point of image.

2.) if image dragged in right left direction , whole image dragged after image should start starting point of image.

3.) means there should no stop point or end point of image , image behaves 360`.

can please me achieve above behavior.

in advance.

hi,

i got actual problem related coordinates , fixed prblem ignore post.

thanks lot.



Silverlight  >  Programming Silverlight with .NET – General



Comments

Popular posts from this blog

Reindexing

Users List

List of charts