JS and jquery cannot crop images, but they only display an illusion that the idea of cropping images using the obtained coordinate values and original images on the server is as follows: JS, jquery cannot crop images, but it only shows an illusion.
My implementation method is as follows:
1. Upload the selected image to the server
2. Send the coordinates of the rectangle frame of the selected avatar to the server, including the width and height of the rectangle frame, the x and y coordinates in the upper left corner, and the height and width of the image.
3. Use the obtained coordinate values on the server and the original image, and use JAVA for cropping.
-----------------------------------
Jquery cropping effect display, using imgAreaSelect
Http://odyniec.net/projects/imgareaselect/
Http://www.cnblogs.com/mizzle/archive/2011/10/13/2209891.html
The effect is as follows:
Crop images using JAVA
Http://blog.csdn.net/renfyjava/article/details/9942743
My example:
I display a four-dimensional Avatar at the same time. Some code is as follows:
The Code is as follows: