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

Maintaining an image's aspect ratio

3 Answers 81 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Roger Withnell
Top achievements
Rank 1
Roger Withnell asked on 08 Dec 2009, 06:53 PM
When resizing an image in the editor by dragging the handles, how do I maintain the aspect ration?

Preferably, dragging a corner handle would maintain the aspect ratio and dragging a handle in the middle of a side would not.

Thanking you in anticipation.

Roger

3 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 10 Dec 2009, 12:59 PM
Hi Roger,

RadEditor is an editable <iframe /> which is based on the rich text editing support of the browsers. Currently FireFox 3 provides this feature while Internet Explorer does not, but it is achievable due to the support of oncontrolselect event. 

In the following KB article you can find an example of how to implement this feature for Internet Explorer using javascript:

Resizing images proportional in Internet Explorer

All the best,
Dobromir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
dipak
Top achievements
Rank 1
answered on 23 Dec 2013, 05:39 PM
while resizing or cropping..  is it possible to add "padding" into image so if image is not square and i want it to be square ? and vice versa ?
0
Ianko
Telerik team
answered on 24 Dec 2013, 01:15 PM
Hi Dipak,

You could customize the Crop dialog and add a logic that implements the desired functionality to modify the padding of the image and return the modified image into the ImageEditor instead of the original one. I suggest following this live example, in which is explained how to customize a built-in dialog.

If you have any difficulties with this approach, I recommend contacting us within a formal support thread. 

Regards,
Ianko
Telerik
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 the blog feed now.
Tags
Editor
Asked by
Roger Withnell
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
dipak
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or