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

Async Upload, fixed crop and resize image

1 Answer 551 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Saltug
Top achievements
Rank 2
Saltug asked on 24 Apr 2014, 09:14 PM
Hello,

I want to add some images to my database to a binary data field.
But the image sould always the same size. But the original file can be different.
When i add the fila via Async upload, the file must first resize to my dimensions and fit the longer edge. Then the crop tool should run automatically and appears on imageEditor (no other tools) and the user sould set the crop the image by the correct aspect ratio.

At the final i want it save as a binary file to my database.

What i want is all images in my database sould 800 px x 300 px. But this is not a most common used ratio. Images must resized and cropped. This is ok but the image must always cropped by the user, because it can crop a false side if i make this automatically.

I dont want a tool inside my imageEditor. The crop will run after the upload and users will crop the image only at 800x300 and click a button to finish the proces.

So how can i make this? Is there a sample that i can use it?

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 29 Apr 2014, 10:48 AM
Hi Serhan,

I have attached a sample that shows how to upload an image in the RadImageEditor control, to customize the Crop command so that the size of the crop box is changed and to fire the crop command when the image is uploaded.

This sample is based on the Upload and Edit Image demo and the information in the help article Custom Crop Settings.

Note that the uploaded image is accessible in the event handler RadImageEditor1_ImageLoading as the image variable (which is an instance of EditableImage), so you can use it to change the size of the image in the editor as required in your scenario.

Regards,
Slav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ImageEditor
Asked by
Saltug
Top achievements
Rank 2
Answers by
Slav
Telerik team
Share this question
or