# 涂图美颜-图像sdk-uniapp插件-一颗优雅草科技
涂图美颜-图像sdk-uniapp插件-一颗优雅草科技-插件限时免费
插件下载地址:
https://ext.dcloud.net.cn/plugin?id=4065
#### 介绍
TuSDK 使用指南
TuSDK(涂图)是移动端图像处理的一站式解决方案,它全面覆盖相机拍照、图片编辑、人像美化、贴纸装饰、实时滤镜等需求。
TuSDK 支持 iOS 和 Android 两大平台,适配众多主流机型。开发者无需关心底层技术及具体实现,直接调用相应模块即可实现专业的图像处理功能,从而有效降低产品开发的技术门槛和时间成本。
注册 TUTUCLOUD 帐号并创建一个应用,即可开始使用。
#### 更多关于涂图图像sdk的介绍请看官网介绍
涂图:https://tutucloud.com/docs/image-guide/guide#_功能说明_0
涂图官方demo下载:
![](https://doccun.youyacao.com/showdoc_16119172122136313232.png)
优雅草对接产品蜻蜓s演示下载:
使用方法演示:
```
mageedit(){
const TuSDKImageEdit = uni.requireNativePlugin('youyacao-TuSDKImageEdit');
TuSDKImageEdit.edit({
path:"/sdcard/DCIM/Camera/IMG_20210124_132411.jpg"
}, result => {
const msg = JSON.stringify(result);
uni.showModal({
content: msg,
showCancel: false
});
});
},
// 多图
Imageedit2(){
const TuSDKImageEdit = uni.requireNativePlugin('youyacao-TuSDKImageEdit');
TuSDKImageEdit.editV2({
list:["/sdcard/DCIM/Camera/IMG_20210124_132411.jpg",
"/sdcard/DCIM/Camera/IMG_20210124_132414.jpg",
"/sdcard/DCIM/Camera/IMG_20210124_132417.jpg"]
}, result => {
const msg = JSON.stringify(result);
uni.showModal({
content: msg,
showCancel: false
});
});
// uni.chooseImage({
// count: 3,
// sourceType: [ 'album'],
// success: function (res) {
// console.log(res);
// // uni.showModal({
// // content: JSON.stringify(res.tempFilePath),
// // showCancel: false
// // });
// var sss = plus.io.convertLocalFileSystemURL( "/storage/emulated/0/Android/data/com.qingting.live/apps/__UNI__AC7D13F/doc/uniapp_temp_1611465883526/compressed/1611465887281_IMG_20210124_132411.jpg" );
// console.log(sss);
// }
// });
},
```
示范实例文件:
```
<template>
<view>
<view class="uni-padding-wrap uni-common-mt">
<button type="primary" @tap="edit()">选取视频开始编辑</button>
<button type="primary" @tap="Imageedit()">选取图片开始编辑</button>
<button type="primary" @tap="Imageedit2()">选取多图图片开始编辑</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
Imageedit(){
const TuSDKImageEdit = uni.requireNativePlugin('youyacao-TuSDKImageEdit');
TuSDKImageEdit.edit({
path:"/sdcard/DCIM/Camera/IMG_20210124_132411.jpg"
}, result => {
const msg = JSON.stringify(result);
uni.showModal({
content: msg,
showCancel: false
});
});
},
Imageedit2(){
const TuSDKImageEdit = uni.requireNativePlugin('youyacao-TuSDKImageEdit');
TuSDKImageEdit.editV2({
list:["/sdcard/DCIM/Camera/IMG_20210124_132411.jpg",
"/sdcard/DCIM/Camera/IMG_20210124_132414.jpg",
"/sdcard/DCIM/Camera/IMG_20210124_132417.jpg"]
}, result => {
const msg = JSON.stringify(result);
uni.showModal({
content: msg,
showCancel: false
});
});
// uni.chooseImage({
// count: 3,
// sourceType: [ 'album'],
// success: function (res) {
// console.log(res);
// // uni.showModal({
// // content: JSON.stringify(res.tempFilePath),
// // showCancel: false
// // });
// var sss = plus.io.convertLocalFileSystemURL( "/storage/emulated/0/Android/data/com.qingting.live/apps/__UNI__AC7D13F/doc/uniapp_temp_1611465883526/compressed/1611465887281_IMG_20210124_132411.jpg" );
// console.log(sss);
// }
// });
},
edit(){
const TuSDKEdit = uni.requireNativePlugin('AThree-TuSDKEdit');
TuSDKEdit.edit({
list:["file:///storage/emulated/0/DCIM/Camera/VID_20201211_175434.mp4",
"file:///storage/emulated/0/DCIM/Camera/VID_20201211_175442.mp4" ]
}, result => {
const msg = JSON.stringify(result);
uni.showModal({
content: msg,
showCancel: false
});
});
// uni.chooseVideo({
// count: 2,
// sourceType: [ 'album'],
// success: function (res) {
// console.log(JSON.stringify(res.tempFilePath));
// uni.showModal({
// content: JSON.stringify(res.tempFilePath),
// showCancel: false
// });
// }
// });
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200upx;
width: 200upx;
margin-top: 200upx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50upx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36upx;
color: #8f8f94;
}
</style>
```