how to move the image control to specific x y co ordination by using of animation class in windows phone 7 -
please me how move image automatically specific x y position using of animation class in windows phone 7, have tried point animation class not working image control working object, please tell me kind of animation class should use moving image in windows phone 7
and code
xaml
</pointanimation> </storyboard> </canvas.resources> <image source="qq.jpg" width="200" height="100" x:name="myimage" canvas.left="10" canvas.top="10" /> </canvas> </grid> c#
private void canvas1_mouseleftbuttondown(object sender, mousebuttoneventargs e) { point mypoint = new point(); mypoint.x = 10; mypoint.y = 200; mypointanimation.to = mypoint; mystoryboard.begin(); }
you can :
<image x:name="myimage" canvas.left="10" canvas.top="10" width="200" height="100" source="/assets/qq.jpg"> <image.rendertransform> <translatetransform /> </image.rendertransform> </image> and in code behind :
translatetransform trans = myimage.rendertransform translatetransform; doubleanimation anima1 = new doubleanimation(); anima1.to = 150; storyboard.settarget(anima1, trans); storyboard.settargetproperty(anima1, new propertypath(translatetransform.xproperty)); // create storyboard, add animation, , fire up! storyboard storyboard = new storyboard(); storyboard.children.add(anima1); storyboard.begin();
Comments
Post a Comment