Many websites orCommunityThe system supports users to upload and set their own profile pictures. However, the size of profile pictures is limited, and the size of uploaded photos is usually large, so you do not need to use the whole picture. In this case, you need to take a part of the image as the final Avatar After the user uploads the image. Currently, many well-known websites such as flicker and Yahoo have provided such functions.
Based on ASP. it is not difficult to develop such controls using the webcontrol mechanism of net. Here we will introduce a webimagemaker ), with this control, you can easily use it on your own website :)
The following is a link to the control (including source code download ):
Http://www.codeproject.com/aspnet/ImageCMS1.asp
I made further improvements to this control:
1. Restrict the selection box to the original image range;
2. Supports synchronous preview of the captured target image.
Below is a picture:
Download the improved code here:/files/laser_lu/webimagemaker.rar
Finally, if you have any questions, I would like to ask the experts: the preview function I have implemented is not very ideal, that is, the image will sometimes flash when scaling the selection box (IE6 or below, IE7 is normal, Firefox, Safari, and other browsers are normal), but not when you move the selection box. I wonder if the experts have a better way to zoom in and preview images? Please kindly advise! :)