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

大学生毕业设计网站成都餐饮小程序开发

大学生毕业设计网站,成都餐饮小程序开发,西安通程建设工程 网站,单位网址怎么编一般用于图片打印文字或图片的坐标获取,代码来自AI有改动。 功能#xff1a;本地图选择后不上传直接可比划线条作为对角线得到矩形#xff0c;动态显示坐标 按下鼠标开始松开鼠标结束。有细微BUG但不影响坐标获取。 !DOCTYPE html html langen本地图选择后不上传直接可比划线条作为对角线得到矩形动态显示坐标 按下鼠标开始松开鼠标结束。有细微BUG但不影响坐标获取。 !DOCTYPE html html langen headmeta charsetUTF-8meta nameviewport contentwidthdevice-width, initial-scale1.0titleDraw Rectangle on Image/titlestyle#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 bodyh2Draw Rectangle and Track Position/h2input typefile idimageUpload acceptimage/*div idcontainer/divh3Current Rectangle Info/h3textarea idcurrentInfo readonlyX: -, Y: -, Width: -, Height: -/textareah3Log of Rectangles/h3textarea idlogInfo readonly/textareascriptconst 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.w-s-a.com/news/157340/

相关文章:

  • 网站开发的项目17岁高清免费观看完整版
  • 手机网站建设多少钱一个门网站源码
  • 重庆 网站开发天津住房和城乡建设厅官方网站
  • 泰安高级网站建设推广厦门高端网站建设定制
  • jsp网站开发引用文献手机seo排名
  • 创建一家网站如何创设计网页的快捷网站
  • 1688代加工官方网站h5开发教程
  • 静态网站源码下载网站怎么显示备案号
  • 网站代码设计网站开发维护任职要求
  • 长寿做网站的电话怎么快速刷排名
  • 上海市中学生典型事例网站邯郸全网推广
  • 厦门网站建设680元好男人的最好的影院
  • 石家庄网站建设设计产品设计专业就业前景
  • 网站移动排名做最好最全的命理网站
  • 网站怎么防黑客杭州市做外贸网站的公司
  • 网站推广公司认准乐云seo易语言做网站登录
  • 配色设计网站推荐网站下拉菜单重叠
  • 内容展示型网站特点在北京注册公司需要多少钱
  • h5网站源代码创意设计理念
  • 岳阳网站开发服务推广运营平台
  • 网站开发得多长时间湖南建设人力资源网证书查询
  • 论坛网站开发网络营销是什么时候产生的
  • 帮人做网站赚钱无忧软文网
  • 做网站要不要营业执照重庆网站优化seo公司
  • 学院宣传网站建设简介做网站没灵感
  • 网站建设终稿确认书网站意义学校
  • 3小时网站建设平台专业制作教学课件
  • 曲阜网站建设百度开户现货黄金什么网站可以做直播
  • 比较好的企业建站平台小程序开发外包该注意些什么
  • 建行官网官网网站吗二次元风格wordpress模板