Animating loaded image.

5 posts, 1 answers
  1. David
    David avatar
    9 posts
    Member since:
    Sep 2012

    Posted 25 Mar 2013 Link to this post

    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.
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Mar 2013 Link to this post

    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.
  3. DevCraft banner
  4. David
    David avatar
    9 posts
    Member since:
    Sep 2012

    Posted 26 Mar 2013 Link to this post

    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 
  5. Answer
    Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Mar 2013 Link to this post

    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.
  6. David
    David avatar
    9 posts
    Member since:
    Sep 2012

    Posted 26 Mar 2013 Link to this post

    Hi Victor.

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

    Thanks,
    David.
Back to Top
DevCraft banner