views:

194

answers:

2

Once I upload an image to the server (asp.net), I need to display this uploaded image for cropping. What is the best-practice to achieve the same(ie how do I send te image back to the client for display)? . I have tried giving a preview option before upload. But this does not seem to be working for all images. See here

Addition : [I know JCrop is available , but the point of the question is how to send the image back ofr display]

+2  A: 

You can first upload the image to your server and show a preview from there. After successful upload you can use javascript to select the region for crop.

Here is a nice crop plugin in jQuery.

Then you can get the dimensions of the crop region and use C# or any other server side language to make a new image with these dimensions.

See

Image Editing: Saving, Cropping, and Resizing

rahul
once the image is uploaded, how do I show the preview.. That is my question.
Ajay
You can set the source of an img tag to the location of image in server.
rahul
A: 

Check this Blog post using JCrop

Anuraj