Zoom out is not working in opera, safari, chrome

2 posts, 0 answers
  1. Chintha
    Chintha avatar
    11 posts
    Member since:
    May 2012

    Posted 07 Nov 2012 Link to this post

    I used this code to 'zoom out'  the large image.It working only in ie8, firefox.
    Image width and height is getting '0' in other browsers.
    please tell me how to get the editable image height and width in chrome browser.

     function OnClientLoad(sender, args) {
                var editor = $find("<%= rieControl.ClientID %>");
                if (sender._imageKey) {
                    var Width = sender.getEditableImage().get_width();
                    var Height = sender.getEditableImage().get_height();
                    if (!isNaN(Number(Width)) && Number(Width) != 0 && !isNaN(Number(Height)) && Number(Height) != 0) {
                        if (Width > 1000 || Height > 600) {
                            var widthPercentage = (1000 * 100) / Width  
    ;                        var heightPercentage = (600 * 100) / Height;
                             widthPercentage = Math.floor(widthPercentage);
                            heightPercentage = Math.floor(heightPercentage);
                            if (heightPercentage > widthPercentage) {
                            else {
     <telerik:RadImageEditor ID="rieControl" runat="server" OnClientLoad="OnClientLoad" >
  2. Vessy
    Vessy avatar
    1893 posts

    Posted 09 Nov 2012 Link to this post

    Hi Chintha,

    I managed to reproduce the described issue and I can confirm that it is a bug, connected with the newly implemented CanvasMode of the ImageEditor (which is set by default). I have logged it into our PIT system so you could track its progress here: PITS. As well, your Telerik points have been updated accordingly.

    For the time being, you could workaround the problem by setting the ImageEditor's CanvasMode property to "No".

    Additionally, I just want to mention that if 1000x600 is the size of your ImageEditor, you could use the built-in zoomBestFit() method. The current implementation of zoomToBestFit functionality is to scale down the loaded image if it is larger than the ViewPort area.

    Kind regards,
    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.
Back to Top