canvas.toTempFilePath截图保存图片,图片有严重的残影
小游戏渲染模式为Webgl时,canvas.toTempFilePath截图保存图片后,图片有严重的边缘残影。渲染模式为canvas时,没有这个问题。
在小游戏里是正常的,显示没有任何问题。
代码:
var canvas = cc.game.canvas;
var height = canvas.height;
var width = canvas.width;
canvas.toTempFilePath({
x: 0,
y: 0,
width: width,
height: height,
destWidth: width,
destHeight: height,
success (res) {
console.log(res);
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success:function(r){
console.log(r);
cc.instantiate(that.tipsPrefab).getComponent(‘Tips’).init(that.node, ‘保存成功’, 0, 0, 500);
},
fail:function(r){
console.log(r);
}
})
}
})
