New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

How to Initially Zoom the Loaded Image to Best Fit

How to

Zoom the image loaded in RadImageEditor to best fit the editable area of the control. on initial load.

Solution

In order to zoom to best fit the loaded image, you can attach a handler to the ImageEditor's client-side ImageLoad event and call the controls zoomBestFit() method in it.

<telerik:RadImageEditor ID="RadImageEditor1" runat="server" RenderMode="Lightweight" ImageUrl="~/Images/hay.jpg" Width="790" Height="430px" OnClientImageLoad="onImageLoad">
</telerik:RadImageEditor>
<script>
    function onImageLoad(imageEditor, args) {
       imageEditor.zoomBestFit();
    }
</script>

See Also

In this article
Not finding the help you need? Improve this article