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

黑龙江交通系统网站建设aso优化服务

黑龙江交通系统网站建设,aso优化服务,在线长链接转短链接,c2c网站建设系统一般用于图片打印文字或图片的坐标获取,代码来自AI有改动。 功能&#xff1a;本地图选择后不上传直接可比划线条作为对角线得到矩形&#xff0c;动态显示坐标 按下鼠标开始松开鼠标结束。有细微BUG但不影响坐标获取。 <!DOCTYPE html> <html lang"en">…

一般用于图片打印文字或图片的坐标获取,代码来自AI有改动。

功能:本地图选择后不上传直接可比划线条作为对角线得到矩形,动态显示坐标

按下鼠标开始松开鼠标结束。有细微BUG但不影响坐标获取。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Draw Rectangle on Image</title><style>#container {position: relative;display: inline-block;border: 1px solid #333;cursor: crosshair;overflow: hidden;}.rectangle {position: absolute;border: 1px dashed red;background-color: rgba(255, 0, 0, 0.1);}textarea {width: 100%;height: 80px;margin-top: 10px;font-family: monospace;}</style>
</head>
<body><h2>Draw Rectangle and Track Position</h2><input type="file" id="imageUpload" accept="image/*"><div id="container"></div><h3>Current Rectangle Info</h3><textarea id="currentInfo" readonly>X: -, Y: -, Width: -, Height: -</textarea><h3>Log of Rectangles</h3><textarea id="logInfo" readonly></textarea><script>const container = document.getElementById('container');const imageUpload = document.getElementById('imageUpload');const currentInfo = document.getElementById('currentInfo');const logInfo = document.getElementById('logInfo');let startX, startY, rect, isDrawing = false;// Change the background image when a file is uploaded and adjust container sizeimageUpload.addEventListener('change', (event) => {const file = event.target.files[0];if (file) {const reader = new FileReader();reader.onload = (e) => {const img = new Image();img.onload = () => {container.style.width = `${img.width}px`;container.style.height = `${img.height}px`;container.style.backgroundImage = `url('${e.target.result}')`;};img.src = e.target.result;};reader.readAsDataURL(file);}});container.addEventListener('mousedown', (event) => {// Remove any previous rectangle and reset infoif (rect) {rect.remove();}currentInfo.value = "X: -, Y: -, W: -, H: -";// Start drawing the rectanglestartX = event.offsetX;startY = event.offsetY;isDrawing = true;// Create a new rectangle elementrect = document.createElement('div');rect.classList.add('rectangle');rect.style.left = `${startX}px`;rect.style.top = `${startY}px`;rect.style.width = `0px`;rect.style.height = `0px`;container.appendChild(rect);});container.addEventListener('mousemove', (event) => {if (!isDrawing) return;// Calculate current width and height based on mouse positionconst currentX = event.offsetX;const currentY = event.offsetY;const width = Math.abs(currentX - startX);const height = Math.abs(currentY - startY);// Set rectangle position and size based on mouse directionrect.style.left = `${Math.min(startX, currentX)}px`;rect.style.top = `${Math.min(startY, currentY)}px`;rect.style.width = `${width}px`;rect.style.height = `${height}px`;// Update the current info displaycurrentInfo.value = `X: ${Math.min(startX, currentX)}, Y: ${Math.min(startY, currentY)}, W: ${width}, H: ${height}`;});container.addEventListener('mouseup', (event) => {if (!isDrawing) return;isDrawing = false;// Record the final rectangle detailsconst finalX = parseInt(rect.style.left);const finalY = parseInt(rect.style.top);const finalWidth = parseInt(rect.style.width);const finalHeight = parseInt(rect.style.height);// Append the log information to the logInfo textarealogInfo.value += `Rectangle - X: ${finalX}, Y: ${finalY}, W: ${finalWidth}, H: ${finalHeight}\n`;// Stop drawing for a new sessionisDrawing = false;});</script>
</body>
</html>

http://www.ritt.cn/news/22595.html

相关文章:

  • 网站建设优化服务价位seo的目的是什么
  • 浙江省建设工程造价协会网站免费做网站怎么做网站吗
  • 国家卫生健康委员会官网官网51趣优化网络seo工程师教程
  • wordpress 安装 失败杭州关键词优化平台
  • 怎么给网站做域名重定向个人购买链接
  • 2010网站建设管理百度发布平台官网
  • 如何做阿里巴巴企业网站南昌seo网站排名
  • 如何做响应式的网站最新新闻今天最新新闻
  • 新疆建设安监局网站查询百度电脑版下载官网
  • 网站管理员怎么做联系方式江门网站建设
  • 手机免费做网站广州白云区今天的消息
  • 建卡盟网站建设 网站定制开发十大互联网广告公司
  • 柳市做公司网站潍坊seo关键词排名
  • 重庆的网站设计公司价格网络营销师证书查询
  • 苏州做网站设计的公司有哪些公众号关键词排名优化
  • 做ppt素材的网站有哪些南宁市优化网站公司
  • 遵化市有做奇麟网站的吗济南seo外包公司
  • 静态学校网站做毕业设计网站建设的整体流程有哪些
  • 做葡萄酒的网站网站建设的数字化和互联网化
  • 做简历比较好的网站叫什么国内搜索引擎优化的公司
  • pc 手机自适应网站用什么做杭州seo培训
  • 东莞网站上排名百度seo优化推广公司
  • 北京公司网站建设定制google优化排名
  • vs做bs网站天天seo百度点击器
  • 30岁学前端开发是不是晚了seo外包公司费用
  • 榆林做网站的公司腾讯新闻最新消息
  • 做网站游戏推广赚钱吗今日热搜榜排名最新
  • 自己怎么做彩票网站竞价托管外包代运营
  • 网站文章更新数量网站制作的流程
  • 建网站可行性分析大数据精准营销获客