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

Image Editor control resize

1 Answer 298 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Sankar
Top achievements
Rank 1
Sankar asked on 29 Mar 2016, 09:51 PM

Hi,
I have a problem with resizing image editor control based on the given width and height. Also resize the control based on image size. Now it looks like by default it is taking some width and height and I can't resize it smaller than that default size.

 

Thanks

Sankar

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 01 Apr 2016, 01:15 PM
Hi Sankar,

You can resize the ImageEditor depending on the size of the loaded image through its set_width() and set_height() client-side methods. For example, you can do it in its ClientImageLoad event handler.

For example:
<telerik:RadImageEditor ID="ImageEditor1" runat="server" ImageUrl="~/Images/PERIC.jpg" OnClientImageLoad="onImageLoad">
    <Tools>
        <telerik:ImageEditorToolGroup>
            <telerik:ImageEditorTool CommandName="Save" />
        </telerik:ImageEditorToolGroup>
    </Tools>
</telerik:RadImageEditor>
<script>
    function onImageLoad(imageEditor, args) {
        var editableEl = imageEditor.getEditableElement();
        var width = editableEl.width;
        var height = editableEl.height;
        imageEditor.set_width(width)
        imageEditor.set_height(height)
    }
</script>

Regards,
Vessy
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ImageEditor
Asked by
Sankar
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or