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

Zoom out is not working in opera, safari, chrome

1 Answer 65 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Chintha
Top achievements
Rank 1
Chintha asked on 07 Nov 2012, 08:36 AM
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.

Script:
 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) {
                            sender.zoomImage(widthPercentage);
                        }
                        else {
                            sender.zoomImage(heightPercentage);
                               }
                    }
                }
            }
        }
aspx:
 <telerik:RadImageEditor ID="rieControl" runat="server" OnClientLoad="OnClientLoad" >
                    </telerik:RadImageEditor>

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 09 Nov 2012, 05:41 PM
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,
Vesi
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.
Tags
ImageEditor
Asked by
Chintha
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or