This is a migrated thread and some comments may be shown as answers.

Animating loaded image.

4 Answers 77 Views
PanAndZoomImage
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 25 Mar 2013, 03:26 PM
I'm using single control for showing image retrieved from the web by using he following code:

<slideView:PanAndZoomImage Source="{Binding Thumb}" />

So I want to add rotate animation which will be performed when image is loaded. So image must be appear by rotating itself.
Is there a way to do that ? A code snippet showing a example would be nice.

Thanks in advance,
David.

4 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 26 Mar 2013, 08:56 AM
Hi David,

Thanks for writing.
PanAndZoomImage does not provide such functionality however it is trivial to implement.
All you need to do is to put an Image element on top of the pan and zoom image.

Initially the pan zoom's opacity will be zero and the image's will be 1. When the image is loaded you can apply your animation on the image. Then, when the animation finishes you just swap the opacities of PanAndZoomImage and the Image on top of it and you're done.

Kind regards,
Victor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
David
Top achievements
Rank 1
answered on 26 Mar 2013, 09:54 AM
Hi Victor.

Thanks for the answer. Agree it's a trivial to do, but not a "good" way to do that. So if I developed gallery app with lot of images in it then I have to keep a clone for every image and then remove it from tree. It's not a right way. I was hoping that Telerik controls will provide such a functionality, but it seems I have to wait for that. Any way thanks for the coll controls.

Kind Regards,
David 
0
Accepted
Victor
Telerik team
answered on 26 Mar 2013, 11:20 AM
Hello David,

Yes, I suppose in the case of a gallery with many images that would be less than optimal. Actually, you can animate the pan and zoom image itself. You can create your own custom control that will aggregate PanAndZoomImage. Internally, you will wait for the image to be downloaded or opened and then you can animate the pan and zoom image. After the animation is finished you can allow the pan and zoom image to listen for user gestures. Finally, in your image list you can use the custom control as the data template for your images.

This way you will not have to dynamically add, remove or tweak any external elements.

Greetings,
Victor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
David
Top achievements
Rank 1
answered on 26 Mar 2013, 11:26 AM
Hi Victor.

Agree related to custom control. I think it's a best way to fix the issue.

Thanks,
David.
Tags
PanAndZoomImage
Asked by
David
Top achievements
Rank 1
Answers by
Victor
Telerik team
David
Top achievements
Rank 1
Share this question
or