Commit 8134a94e authored by 和慭琛's avatar 和慭琛

初步添加水印

parent 1c343a45
...@@ -45,7 +45,12 @@ ...@@ -45,7 +45,12 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '走线照片 (' + this.current_count + '/'+ this.image_count + ')' title: '走线照片 (' + this.current_count + '/'+ this.image_count + ')'
}); })
uni.setNavigationBarColor({
frontColor:'#FFFFFF',
backgroundColor:'#333333',
})
}, },
//照片预览 //照片预览
......
...@@ -155,19 +155,21 @@ ...@@ -155,19 +155,21 @@
//加入 水印文字 //加入 水印文字
this.canvas.setFontSize(18) this.canvas.setFontSize(18)
this.canvas.setFillStyle('#8a2929') this.canvas.setFillStyle('#8a2929')
this.canvas.rotate(30 * Math.PI / 180); //this.canvas.rotate(30 * Math.PI / 180);
let textToWidth = res.width * 0.5; let textToWidth = res.width * 0.5;
let textToHeight = res.height * 0.3; let textToHeight = res.height * 0.3;
this.canvas.fillText('我是水印', textToWidth, textToHeight) this.canvas.fillText('我是水印', 100, 100)
//加入 水印图片 //加入 水印图片
this.canvas.drawImage(this.markPath, 50, 50, 200, 40) this.canvas.drawImage(this.markPath, 0, 0, res.width / 3, res.height / 3)
this.canvas.draw()
uni.showLoading({ uni.showLoading({
title: '数据处理中...', title: '数据处理中...',
icon: 'loading' icon: 'loading'
}) })
//that.canvas.draw()
this.exportCanvasTempFilePath(res.width,res.height) this.exportCanvasTempFilePath(res.width,res.height)
...@@ -203,6 +205,8 @@ ...@@ -203,6 +205,8 @@
}); });
}, 1000); }, 1000);
//TODO........ //TODO........
...@@ -235,6 +239,11 @@ ...@@ -235,6 +239,11 @@
}) })
}, },
//第六步 返回上层界面
goBack: function(){
},
//获取当前时间 //获取当前时间
getTime:function(){ getTime:function(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment