Commit a564e11c authored by 李俊赕's avatar 李俊赕

img

parent 6c8aa5b9
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<cover-view class="locationText u-m-l-20 u-m-t-10">{{date}}</cover-view> <cover-view class="locationText u-m-l-20 u-m-t-10">{{date}}</cover-view>
</cover-view> </cover-view>
<cover-image class="liveWatermarkNormal" mode="aspectFit" src="@/static/live_mark.png"></cover-image> <cover-image class="liveWatermarkNormal" mode="aspectFit" :src="liveWaterMarkImage"></cover-image>
</camera> </camera>
<cover-view class="bottomView"> <cover-view class="bottomView">
<cover-image class='switchIcon' :src='icon_switch_white' @click="switchClick()"> </cover-image> <cover-image class='switchIcon' :src='icon_switch_white' @click="switchClick()"> </cover-image>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
icon_take:'https://qn-static.banshouhui.com/take.png', icon_take:'https://qn-static.banshouhui.com/take.png',
icon_switch_white:'https://qn-static.banshouhui.com/switch_white.png', icon_switch_white:'https://qn-static.banshouhui.com/switch_white.png',
icon_light_on_white:'https://qn-static.banshouhui.com/light_on_white.png', icon_light_on_white:'https://qn-static.banshouhui.com/light_on_white.png',
liveWaterMarkImage:require('@/static/live_mark.png')
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -89,9 +89,6 @@ ...@@ -89,9 +89,6 @@
} }
}); });
}, },
//照片处理 //照片处理
imageChange(options) { imageChange(options) {
var that = this var that = this
...@@ -129,16 +126,17 @@ ...@@ -129,16 +126,17 @@
// //将图片src放到cancas内,宽高为图片大小 // //将图片src放到cancas内,宽高为图片大小
// ctx.drawImage(res.tempFilePaths[0], 0, 0, ress.width / 3, ress.height / 3) // ctx.drawImage(res.tempFilePaths[0], 0, 0, ress.width / 3, ress.height / 3)
that.canvas.setFontSize(18) that.canvas.setFontSize(18)
that.canvas.setFillStyle('#8a2929') // that.canvas.setFillStyle('#8a2929')
that.canvas.rotate(-Math.PI / 2); // that.canvas.rotate(-Math.PI / 2);
let textToWidth = res.width / 3 * 0.5; let textToWidth = res.width / 3 * 0.5;
let textToHeight = res.height / 3 * 0.3; let textToHeight = res.height / 3 * 0.3;
that.canvas.fillText('我是水印', 10, 90) that.canvas.fillText('我是水印', 10, 90)
/** 除了上面的文字水印,这里也可以加入图片水印 */ /** 除了上面的文字水印,这里也可以加入图片水印 */
//ctx.drawImage('/static/watermark.png', 0, 0, ress.width / 3, ress.height / 3) // ctx.drawImage('/static/watermark.png', 0, 0, res.width / 3, ress.height / 3)
ctx.drawImage(this.liveWaterMarkImage, 0, 0, 200, 200)
//----------------------------- //-----------------------------
that.canvas.draw()
uni.showLoading({ uni.showLoading({
title: '数据处理中...', title: '数据处理中...',
icon: 'loading', icon: 'loading',
......
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