当前位置:网站首页>Picture clipping plug-in cropper js
Picture clipping plug-in cropper js
2022-07-02 05:57:00 【Want to eat pineapple crisp】
install
npm install cropperjs
introduce
import 'cropperjs/dist/cropper.css';
import Cropper from 'cropperjs';
Use
const letImg: any = document.querySelector("#cropImg");
(<any>state.cropper) = new Cropper(letImg, {
viewMode: 1,
dragMode: "none",
initialAspectRatio: 1,
aspectRatio: 1,
preview: ".before",
background: false,
autoCropArea: 0.6,
zoomOnWheel: false,
crop: () => {
state.cropperImgBase64 = (<any>state.cropper)
.getCroppedCanvas()
.toDataURL("image/jpeg");
console.log(state.cropperImgBase64);
},
});
Be careful :
- Cannot use local pictures directly
- You can upload preview pictures
边栏推荐
- 正则表达式总结
- Redis key value database [advanced]
- LCD之MIPI协议的一些说明
- Lantern Festival gift - plant vs zombie game (realized by Matlab)
- 神机百炼3.52-Prim
- 1037 Magic Coupon
- [Chongqing Guangdong education] selected reading reference materials of British and American literature of Nanyang Normal University
- ESP8266与STC8H8K单片机联动——天气时钟
- Go language web development is very simple: use templates to separate views from logic
- PHP inner class name is the same as the inner class method name
猜你喜欢

我所理解的DRM显示框架

神机百炼3.53-Kruskal

MySQL transaction and isolation level

Go language web development is very simple: use templates to separate views from logic

Redis Key-Value数据库【初级】

Matplotlib double Y axis + adjust legend position

测试 - 用例篇

Eco express micro engine system has supported one click deployment to cloud hosting

vite如何兼容低版本浏览器

Keepalived installation, use and quick start
随机推荐
PHP gets CPU usage, hard disk usage, and memory usage
Software testing Q & A
PHP read file (read the specified line containing a string in the file)
Stc8h8k Series Assembly and c51 Real combat - NIXIE TUBE displays ADC, Key Series port reply Key number and ADC value
Zzuli:1066 character classification statistics
Generics and generic constraints of typescript
Lambda 表达式 和 方法引用
Practice C language advanced address book design
Huawei Hongmeng OS, is it OK?
memcached安装
图片裁剪插件cropper.js
Zzuli:1067 faulty odometer
TypeScript的泛型和泛型约束
Vite打包后的dist不能直接在浏览器打开吗
《CGNF: CONDITIONAL GRAPH NEURAL FIELDS》阅读笔记
STC8H8K系列匯編和C51實戰——數碼管顯示ADC、按鍵串口回複按鍵號與ADC數值
php读文件(读取文件内含有某字符串的指定行)
File contains vulnerabilities (II)
Reading notes of cgnf: conditional graph neural fields
Fundamentals of software testing