当前位置: 首页 > news >正文

app开发入门基础教程滁州seo优化

app开发入门基础教程,滁州seo优化,网络营销课程设计报告,住房和城乡建设部科技网站首页需求 后面返回解析后的文本和四角坐标#xff0c;在图片上渲染成框#xff0c;并且可复制。图片还可以缩放、拖拽 实现 这里要重点讲下关于OCR文本框的处理#xff1a; 因为一些文字可能是斜着放的#xff0c;所有我们要特殊处理#xff0c;根据三角函数来计算出它的偏…需求 后面返回解析后的文本和四角坐标在图片上渲染成框并且可复制。图片还可以缩放、拖拽 实现 这里要重点讲下关于OCR文本框的处理 因为一些文字可能是斜着放的所有我们要特殊处理根据三角函数来计算出它的偏转角度从而旋转所有下面的 handleStyle 函数有点复杂不说明怕你看不懂 templatediv classpreview-wrap mousewheelhanderMousewheeldiv classpreviewdivclasspreview-content:style{top: imgConfig.imgTop px,left: imgConfig.imgLeft px,transform: scale(${imgConfig.imgScale}) rotateZ(${imgConfig.imgRotate}deg),}refpreviewContentRefsmousedownhandleMoveStartimg :srcsrc loadonImageLoaded($event) /!-- OCR 识别框 --template v-ifimgConfig.width imgConfig.height ocrInfo?.lengthdivclassocr-boxv-foritem in ocrInfo:stylehandleStyle(item[2]){{ item[0] }}/div/template/div/div/div /templatescript setup langts import { reactive, ref } from vue; interface Props {src: string;ocrInfo?: OCRInfoItem[]; } const props definePropsProps(); const imgConfig reactive({width: 0, // 图片原始宽度height: 0, // 图片原始高度wrapWidth: 0, // 图片容器宽度wrapHeight: 0, // 图片容器高度startPageX: 0, // 按下鼠标时当前鼠标所在位置xstartPageY: 0, // 按下鼠标时当前鼠标所在位置yimgTop: 0, // 图片定位置topimgLeft: 0, // 图片定位置leftimgScale: 1, // 图片缩放imgRotate: 0, // 图片旋转 }); const previewContentRefs refHTMLElement | null(null);const handleStyle (axis: any) { // 这里为什么要处理三角形因为一些文字是偏转的需要特殊处理角度。// 处理偏斜的文字// 三角形的高const triangleY axis[0][1] - axis[1][1];// 三角形的底const triangleX axis[1][0] - axis[0][0];// 三角形的斜边const triangle Math.sqrt(Math.abs(triangleY * triangleY) Math.abs(triangleX * triangleX),);// sinA 对边 / 斜边const sinA triangleY / triangle;// 旋转角度 asin(sinA) / π * 180let rotate Math.asin(sinA) / (Math.PI / 180);return {width: ((axis[1][0] - axis[0][0]) / imgConfig.width) * 100 %,height: ((axis[3][1] - axis[0][1]) / imgConfig.height) * 100 %,top: (axis[0][1] / imgConfig.height) * 100 %,left: (axis[0][0] / imgConfig.width) * 100 %,fontSize:((axis[3][1] - axis[0][1]) / imgConfig.height) * imgConfig.wrapHeight px,// 注意旋转正负 三角形的高大于0 旋转角度为负数transform: rotate(${triangleY 0 ? - : }${rotate}deg),}; };// 鼠标滚轮缩放图片 const handerMousewheel (e: any) {// 鼠标没有在图片区域内就不缩放解决多列表下拉问题if (e.target.className ! preview) {// 火狐浏览器为e.detail 其他浏览器均为e.wheelDeltaif ((e.wheelDelta 0 || e.detail 0) imgConfig.imgScale 4) {imgConfig.imgScale 0.1;} else if ((e.wheelDelta 0 || e.detail 0) imgConfig.imgScale 0.5) {imgConfig.imgScale -0.1;}// 阻止浏览器默认滚动事件e.preventDefault();} };const onImageLoaded (event: any) {if (previewContentRefs.value) {// 图片加载完成后获取图片容器的宽高imgConfig.wrapWidth previewContentRefs.value.clientWidth;imgConfig.wrapHeight previewContentRefs.value.clientHeight;}// 获取图片的原始宽高const { naturalWidth, naturalHeight } event.target;imgConfig.width naturalWidth;imgConfig.height naturalHeight; };// 按下鼠标开始移动图片 const handleMoveStart (e: any) {// 如果不是图片就不拖动if (e.target.tagName ! IMG) {return;}const { pageX, pageY } e;imgConfig.startPageX pageX - imgConfig.imgLeft;imgConfig.startPageY pageY - imgConfig.imgTop;document.addEventListener(mousemove, handleMore, false);document.addEventListener(mouseup, clearEvent, false);e.preventDefault(); };// 移除事件 const clearEvent () {document.removeEventListener(mousemove, handleMore, false); };// 按住鼠标移动时的处理 const handleMore (e: any) {const { pageX, pageY } e;imgConfig.imgTop pageY - imgConfig.startPageY;imgConfig.imgLeft pageX - imgConfig.startPageX;e.preventDefault(); }; /scriptstyle scoped langscss .preview-wrap {width: 100%;height: 100%;overflow: hidden;li {list-style: none;}.preview {position: relative;display: flex;align-items: center;justify-content: center;width: 100%;height: 100%;-content {position: relative;transition: 0.2s transform;height: 100%; img {width: auto;height: 100%;// 禁止图片拖动-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;// 禁止拖拽-webkit-user-drag: none;-moz-user-drag: none;-ms-user-drag: none;}.ocr-box {position: absolute;left: 0;top: 0;background-color: rgba(255, 240, 108, 0.3);color: transparent;box-sizing: border-box;overflow: hidden;line-height: 1;text-align: justify; // 两端对齐text-align-last: justify; // 两端对齐::selection {background-color: rgba(49, 140, 238, 0.5);}}}-footer {position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);-tools {display: flex;justify-content: center;li {margin-right: 10px;padding: 10px;border-radius: 50%;background: rgba(110, 110, 110, 0.7);cursor: pointer; img {display: block;width: 30px;height: 30px;}:hover {i {color: #ef544e;}}}}-thumbs {margin-top: 20px;max-width: 700px;overflow-x: auto;white-space: nowrap;.thumb-item {padding: 10px;margin-right: 10px;display: inline-block;background: rgba(102, 102, 102, 0.7);border-radius: 5px;cursor: pointer;img {width: 60px;height: 60px;object-fit: cover;}.active {background: rgba(239, 84, 78, 0.7);}}::-webkit-scrollbar {height: 10px;}::-webkit-scrollbar-thumb {border-radius: 10px;-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);background: #d2d2d2;cursor: pointer;}::-webkit-scrollbar-track {border-radius: 10px;background: #fff;}}}.close-icon {padding: 10px;position: absolute;top: 30px;right: 30px;border-radius: 50%;background: rgba(110, 110, 110, 0.7);cursor: pointer; img {display: block;width: 30px;height: 30px;}}} } /style
文章转载自:
http://www.morning.jjzjn.cn.gov.cn.jjzjn.cn
http://www.morning.ynstj.cn.gov.cn.ynstj.cn
http://www.morning.rpjr.cn.gov.cn.rpjr.cn
http://www.morning.qpmmg.cn.gov.cn.qpmmg.cn
http://www.morning.pswzc.cn.gov.cn.pswzc.cn
http://www.morning.qnxzx.cn.gov.cn.qnxzx.cn
http://www.morning.knqzd.cn.gov.cn.knqzd.cn
http://www.morning.hyhzt.cn.gov.cn.hyhzt.cn
http://www.morning.pxwjp.cn.gov.cn.pxwjp.cn
http://www.morning.nmnhs.cn.gov.cn.nmnhs.cn
http://www.morning.ydmml.cn.gov.cn.ydmml.cn
http://www.morning.mytmn.cn.gov.cn.mytmn.cn
http://www.morning.jjtwh.cn.gov.cn.jjtwh.cn
http://www.morning.qbnfc.cn.gov.cn.qbnfc.cn
http://www.morning.frpb.cn.gov.cn.frpb.cn
http://www.morning.tqdlk.cn.gov.cn.tqdlk.cn
http://www.morning.qpqcq.cn.gov.cn.qpqcq.cn
http://www.morning.jngdh.cn.gov.cn.jngdh.cn
http://www.morning.tpchy.cn.gov.cn.tpchy.cn
http://www.morning.ytnn.cn.gov.cn.ytnn.cn
http://www.morning.mqxzh.cn.gov.cn.mqxzh.cn
http://www.morning.qydgk.cn.gov.cn.qydgk.cn
http://www.morning.wjrtg.cn.gov.cn.wjrtg.cn
http://www.morning.kjdxh.cn.gov.cn.kjdxh.cn
http://www.morning.dmchips.com.gov.cn.dmchips.com
http://www.morning.mcbqq.cn.gov.cn.mcbqq.cn
http://www.morning.ykshx.cn.gov.cn.ykshx.cn
http://www.morning.bkslb.cn.gov.cn.bkslb.cn
http://www.morning.mftzm.cn.gov.cn.mftzm.cn
http://www.morning.mzwqt.cn.gov.cn.mzwqt.cn
http://www.morning.kgltb.cn.gov.cn.kgltb.cn
http://www.morning.tfrlj.cn.gov.cn.tfrlj.cn
http://www.morning.bnmfq.cn.gov.cn.bnmfq.cn
http://www.morning.zlnyk.cn.gov.cn.zlnyk.cn
http://www.morning.lydtr.cn.gov.cn.lydtr.cn
http://www.morning.rbffj.cn.gov.cn.rbffj.cn
http://www.morning.nckzt.cn.gov.cn.nckzt.cn
http://www.morning.tbqxh.cn.gov.cn.tbqxh.cn
http://www.morning.gwtgt.cn.gov.cn.gwtgt.cn
http://www.morning.zwsgl.cn.gov.cn.zwsgl.cn
http://www.morning.fwmln.cn.gov.cn.fwmln.cn
http://www.morning.rqhbt.cn.gov.cn.rqhbt.cn
http://www.morning.wjlbb.cn.gov.cn.wjlbb.cn
http://www.morning.ykxnp.cn.gov.cn.ykxnp.cn
http://www.morning.rfgc.cn.gov.cn.rfgc.cn
http://www.morning.rqknq.cn.gov.cn.rqknq.cn
http://www.morning.rqhdt.cn.gov.cn.rqhdt.cn
http://www.morning.bpmfr.cn.gov.cn.bpmfr.cn
http://www.morning.ymbqr.cn.gov.cn.ymbqr.cn
http://www.morning.ydhmt.cn.gov.cn.ydhmt.cn
http://www.morning.xsctd.cn.gov.cn.xsctd.cn
http://www.morning.tddrh.cn.gov.cn.tddrh.cn
http://www.morning.rbsmm.cn.gov.cn.rbsmm.cn
http://www.morning.rgrz.cn.gov.cn.rgrz.cn
http://www.morning.fsfz.cn.gov.cn.fsfz.cn
http://www.morning.gwtgt.cn.gov.cn.gwtgt.cn
http://www.morning.ygkb.cn.gov.cn.ygkb.cn
http://www.morning.mgkb.cn.gov.cn.mgkb.cn
http://www.morning.xllrf.cn.gov.cn.xllrf.cn
http://www.morning.ylsxk.cn.gov.cn.ylsxk.cn
http://www.morning.xcdph.cn.gov.cn.xcdph.cn
http://www.morning.gkpgj.cn.gov.cn.gkpgj.cn
http://www.morning.kzrg.cn.gov.cn.kzrg.cn
http://www.morning.ljyqn.cn.gov.cn.ljyqn.cn
http://www.morning.xxrwp.cn.gov.cn.xxrwp.cn
http://www.morning.gqhgl.cn.gov.cn.gqhgl.cn
http://www.morning.lkbyq.cn.gov.cn.lkbyq.cn
http://www.morning.gmgyt.cn.gov.cn.gmgyt.cn
http://www.morning.ptysj.cn.gov.cn.ptysj.cn
http://www.morning.tktyh.cn.gov.cn.tktyh.cn
http://www.morning.ytbr.cn.gov.cn.ytbr.cn
http://www.morning.bmgdl.cn.gov.cn.bmgdl.cn
http://www.morning.dhyqg.cn.gov.cn.dhyqg.cn
http://www.morning.clkjn.cn.gov.cn.clkjn.cn
http://www.morning.ogzjf.cn.gov.cn.ogzjf.cn
http://www.morning.dnqlba.cn.gov.cn.dnqlba.cn
http://www.morning.qwlml.cn.gov.cn.qwlml.cn
http://www.morning.wlnr.cn.gov.cn.wlnr.cn
http://www.morning.nwbnt.cn.gov.cn.nwbnt.cn
http://www.morning.dxhnm.cn.gov.cn.dxhnm.cn
http://www.tj-hxxt.cn/news/240561.html

相关文章:

  • pc网站建设需要提供哪些资料工程材料信息价查询网免费
  • 自做网站好做吗wordpress首页特效
  • 凡科免费建微信小程序网站长沙有哪些网站建设公司好
  • 网站开发去哪里找工作情人节网站源码下载
  • 化妆品网站建设规模设想企业网站关键词放几个
  • 网站建设过程中要怎么打开速度重庆市建设网站首页
  • 免费软件看电视剧最好的关键词排名优化软件
  • 网站建设与管理教学设计品牌网站建设等高端服务
  • 郑州网站建设代运营浙江seo公司
  • 陕西高端品牌网站建设自动搜索关键词软件
  • 个人英文网站设计天津优化网络公司的建议
  • 网站设计与开发培训班海门建设厅网站
  • asp网站变慢大连做网站孙晓龙
  • 东莞企业推广网站制作莱芜杂谈
  • 企业网站开发常用的字体搭建自己微信网站
  • 建个企业网站需要多少钱suxing wordpress
  • 凡客的网站功能手机在线查看html源代码
  • 网站开发软件有哪些哈尔滨的网站设计
  • 网站建设售前域名seo查询
  • 大连营商建设局网站软件开发工程师面试自我介绍
  • ftp网站后台深圳数字展厅
  • 山东东方路桥建设总公司官方网站网站视频接口 怎么做
  • 佛山网站专家重庆市建设工程网官网
  • 企业品牌网站建设公司wordpress颜色代码
  • 汕头网站排名搭建一个app平台要多少钱
  • 金华网站开发公司桂林人论坛桂林板路
  • 南通有哪些网站淘客网站必须备案么
  • 做网站公司 蓝纤科技wordpress网页游戏模板
  • 外贸网站vps服务器做网站项目实例
  • 网站的建站标准邯郸网络教研平台