"use strict";const e=require("../vendor.js"),t={addWatermark(t,a){const i=e.index.createCanvasContext("myCanvas");e.index.getImageInfo({src:t,success:s=>{const{width:l,height:n}=s;console.log(s,"imageInfo");const o=390*n/l;i.drawImage(t,0,0,390,o),i.setFontSize(17),i.setFillStyle("#FFD415"),i.rotate(-Math.PI/4),i.fillText(a,-500,400),i.fillText(a,-200,200),i.fillText(a,-200,300),i.fillText(a,-200,400),i.fillText(a,-200,600),i.fillText(a,-550,800),i.draw(!1,()=>{e.index.canvasToTempFilePath({canvasId:"myCanvas",success:t=>{console.log("水印图片地址:",t.tempFilePath),e.index.hideLoading(),e.index.previewMedia({sources:[{url:t.tempFilePath,type:"image"}],current:0})},fail:t=>{e.index.showToast({title:"获取失败",duration:1e3}),console.error(t)}})})}})}};exports.watermark=t;
