首页 > 移动平台 > 详细

uniapp canvas 安卓真机不显示draw

时间:2020-11-30 21:40:55      阅读:170      评论:0      收藏:0      [点我收藏+]

详细问题描述

写图片裁切组件,发现canvas的draw()方法无法进入回调,用了uniapp官方例子里的图片裁切在nvue
页面,也是不行,加了定时也不行

uni-app运行环境说明

app端的nvue页面

targetContext.drawImage(this.url, x, y, width, height, 0, 0, tw, th);
targetContext.draw(false, () => {
uni.canvasToTempFilePath({
canvasId: "target",
success: (res) => {
var path = res.tempFilePath;
// #ifdef H5
if (this.blob) {
path = this.parseBlob(path);
}
// #endif
const data = {
head_img:this.url
}
this.$emit(‘updateHeadImg‘,data)
},
fail: (ev) => {
console.log(ev);
},
complete: () => {
uni.hideLoading();
}
}, this);
});

·回复

是 gcanvas ?


·回复

nvue 页面 引入 vue 页面,会把 vue 页面当作 nvue 处理,nvue 目前不支持直接使用canvas
参考文档底部 如何在 nvue 中使用 canvas https://uniapp.dcloud.io/component/canvas

uniapp canvas 安卓真机不显示draw

原文:https://www.cnblogs.com/fafa12138/p/14063439.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!