微信小程序 > 微信公开课 > 微信小程序开发canvasToTempFilePath报错illegalarguments
微信小程序,微信公开课,微信小程序开发canvasToTempFilePath报错illegalarguments

微信小程序开发canvasToTempFilePath报错illegalarguments

2019-03-15 18:16:34

微信公开课小程序热门讨论关于「微信小程序开发canvasToTempFilePath报错illegalarguments」的小程序开发问题
补充:机型HUAWEInova3e,微信版本703chooseLocalImage:function(e){varthat=this;letidx=ecurrentTargetdatasetidxconsolelog(idx)wxchooseImage({count:1,sizeType:,尺寸sourceType:,
展开:机型:HUAWEInova3e,微信版本:703chooseLocalImage:function(e){varthat=this;letidx=ecurrentTargetdatasetidxconsolelog(idx)wxchooseImage({count:1,sizeType:[original,compressed],尺寸sourceType:[album,camera],来源success(res){var_tempUrl=restempFilePaths[0];thatdatarate=2000000restempFiles[0]size不超过2Mconsolelog(thatdatarate)wxgetImageInfo({src:_tempUrl,success(res){thatsetData({height:parseInt(thatdatawidth*resheightreswidth),imageCanvasshow:false});constctx=wxcreateCanvasContext(imagecanvas);let_width=thatdatawidthlet_height=thatdataheightctxdrawImage(_tempUrl,0,0,_width,_height);ctxdraw()setTimeout(()={thatdrawLocalImageAfter(idx);},200);}})},fail:function(){fail},complete:function(){complete}})},drawLocalImageAfter:function(idx){try{varthat=this;wxcanvasToTempFilePath({quality:thatdatarate,width:thatdatawidth,heght:thatdataheight,fileType:jpg,canvasId:imagecanvas,success:function(res){var_url=thatdatasellerImageUrl_url[idx]=restempFilePathconsolelog(restempFilePath)consolelog(_url);thatsetData({sellerImageUrl:_url,imageCanvasshow:true});},fail:function(err){consolelog(err);}})}catch(err){consolelog(err)}},真机上调试时,第一次报canvasToTempFilePath:fail:illegalarguments,第二次正常,第三次报canvasToTempFilePath:fail:illegalarguments,第四次正常,以此类推,最近才开始出现这个问题,有谁知道为什么吗即速小程序:麻烦提供出现问题的机型和微信版本,以及能复现问题的代码片段(https:developersweixinqqcomminiprogramdevdevtoolsminicodehtml)
更多有关「微信小程序开发canvasToTempFilePath报错illegalarguments」的讨论可以前往微信公开课小程序参与互动哦!
标签:微信公开课,小程序
微信小程序,微信公开课,微信小程序开发canvasToTempFilePath报错illegalarguments

「微信小程序开发canvasToTempFilePath报错illegalarguments」热门讨论订阅

方法1:微信扫描微信公开课小程序码即可订阅热门讨论「微信小程序开发canvasToTempFilePath报错illegalarguments」

方法2:微信搜索微信公开课小程序名称进入,即可订阅热门讨论「微信小程序开发canvasToTempFilePath报错illegalarguments」

方法3:微信网页访问即速商店,长按识别微信公开课小程序码即可订阅热门讨论「微信小程序开发canvasToTempFilePath报错illegalarguments」

微信公开课小程序热门讨论「微信小程序开发canvasToTempFilePath报错illegalarguments」由微信公开课原创摘录于微信小程序商店shop.jisuapp.cn,转载请注明出处。

微信公开课热门讨论「微信小程序开发canvasToTempFilePath报错illegalarguments」由微信公开课开发者向微信用户提供,并对本服务内容、数据资料及其运营行为等真实性、合法性及有效性承担全部责任。