# imagecut **Repository Path**: guohaomeng/imagecut ## Basic Information - **Project Name**: imagecut - **Description**: 用于头像的剪裁上传 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-01-23 - **Last Updated**: 2021-11-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 作业(图像组) ## 使用js插件实现图片裁剪上传功能 ### 具体任务 用户可自由选择上传一张图片,对这张图片可以自由的框选一个局部位置进行裁剪,并将裁剪后的图片保存起来。用JavaScript代码实现。(类似头像图片的裁剪上传) ### 技术要求 - 掌握HTML - 掌握CSS - 会用JavaScript - 了解[jQuery](https://www.runoob.com/jquery/jquery-tutorial.html) - 初步了解[jQuery ajax() 方法](https://www.runoob.com/jquery/ajax-ajax.html) ### Tips 1. 推荐直接使用JS图片裁剪插件cropper.js,可大大降低开发难度。 - cropper.js的GitHub官方文档地址[https://github.com/fengyuanchen/cropperjs](https://github.com/fengyuanchen/cropperjs) - CSDN上大神的简易教程[https://blog.csdn.net/weixin_38023551/article/details/78792400](https://blog.csdn.net/weixin_38023551/article/details/78792400) 2. 图像组只用写前端部分就行了,即能够通过按下按钮在浏览器端获得裁剪后的图片转换成的base64码,并在控制台输出。 - img图片转成base64[https://www.jianshu.com/p/fbe2165a8098](https://www.jianshu.com/p/fbe2165a8098) - 示例:[成品项目示例](https://guohaomeng.github.io/imagecut/)