ImageEditor Zoom Function

7 posts, 0 answers
  1. Chen Jun Ying
    Chen Jun Ying avatar
    22 posts
    Member since:
    Apr 2010

    Posted 24 Feb 2012 Link to this post

    var imEditor = null;
               function GetEditor() {
                   if (!imEditor)
                       imEditor = $find("<%=imgEditor.ClientID %>");
                   return imEditor;
               }
     
               function Zoom() {
                   var $ = $telerik.$;
                   GetEditor().zoomImage(50);

               
    }

    I use above code block to zoom the image during page load. In which stage I should fire the script? I tried it in page prerender and imageeditor prerender but both are not working. the issue is imgEditor can not be found. 
  2. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 27 Feb 2012 Link to this post

    Hello,

    You can use the OnClientLoad client-side event of RadImageEditor to zoom the image, e.g.

    <telerik:RadImageEditor OnClientLoad="OnClientLoad" ID="RIE1" runat="server" ImageUrl="~/Images/bird.jpg"></telerik:RadImageEditor>
    <script type="text/javascript">
        function OnClientLoad(sender) {
            sender.zoomImage(50);
        }
    </script>


    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chen Jun Ying
    Chen Jun Ying avatar
    22 posts
    Member since:
    Apr 2010

    Posted 27 Feb 2012 Link to this post

    Thanks Rumen.

    The scripts works when page loads in the first time.

    My scenario is that I have a button on the page to save any image change (rotation and etc.). The image editor just stopped working after postback. You can not even zoom in/out the images.

    Any ideas?

    I also raised another thread http://www.telerik.com/community/forums/aspnet-ajax/image-editor/image-is-not-saved-after-rotation.aspx 

    The image didn't get saved in most of the time. Is it because ImageEditor caches the image?

    Thanks
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 01 Mar 2012 Link to this post

    Hi Chen,

    I am not quite sure what may be causing the problem that you experience. A possible reason for such behavior may be a JavaScript error thrown on the page during the page load preventing proper initialization of the control.

    However, I believe we are missing the root of the problem. Could you please provide more detailed information on the specific scenario? What exactly you are trying to achieve?

    Regards,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Chen Jun Ying
    Chen Jun Ying avatar
    22 posts
    Member since:
    Apr 2010

    Posted 02 Mar 2012 Link to this post

    The issue is resolved after I use the client side function to force the change you proposed on the other thread.

    Thanks for your help.
  7. Stephanie
    Stephanie avatar
    139 posts
    Member since:
    Aug 2013

    Posted 12 Aug 2015 in reply to Chen Jun Ying Link to this post

    I tried this code and it skews the image and doesn't just change the zoom. If I use the toolbar to get to 50% zoom it looks fine. If I use this code the picture proportions are way off.
  8. Vessy
    Admin
    Vessy avatar
    1382 posts

    Posted 13 Aug 2015 Link to this post

    Hello Stephanie,

    I have already answered your other thread on the subject, please, refer my answer here: http://www.telerik.com/forums/zoom-not-working

    Regards,
    Vessy
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017