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

苏州吴中区做网站的seo新人怎么发外链

苏州吴中区做网站的,seo新人怎么发外链,网页设计与制作实训报告实训目的,海外推广代理公司这段代码实现了一个简单的图像标注工具&#xff0c;允许用户在加载的图像上进行点选标注&#xff0c;并且通过右键确认一个点序列来形成一个多边形。 标注效果如下 实现代码如下 <!DOCTYPE html> <html lang"en"> <head><meta charset"U…

这段代码实现了一个简单的图像标注工具,允许用户在加载的图像上进行点选标注,并且通过右键确认一个点序列来形成一个多边形。

标注效果如下

实现代码如下

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Image Annotation</title><style>canvas {border: 1px solid black; /* 给画布添加边框 */}</style>
</head>
<body><!-- 文件输入控件 -->
<input type="file" id="file-input">
<!-- 用于显示图像和标注的画布 -->
<canvas id="image-canvas"></canvas><script>const fileInput = document.getElementById('file-input'); // 获取文件输入元素const canvas = document.getElementById('image-canvas'); // 获取画布元素const ctx = canvas.getContext('2d'); // 获取画布的2D渲染上下文let drawing = false; // 标记是否正在绘图let ix = -1, iy = -1; // 当前鼠标位置的坐标let points = []; // 当前正在绘制的点列表let pointList = []; // 已完成的点列表// 当选择文件时触发fileInput.addEventListener('change', function (event) {const file = event.target.files[0]; // 获取选择的文件const reader = new FileReader(); // 创建文件读取器// 文件读取完成后执行reader.onload = function (event) {const img = new Image(); // 创建图像对象img.src = event.target.result; // 将读取的数据赋值给图像源// 图像加载完成后执行img.onload = function () {canvas.width = img.width; // 设置画布宽度为图像宽度canvas.height = img.height; // 设置画布高度为图像高度ctx.drawImage(img, 0, 0); // 在画布上绘制图像};};reader.readAsDataURL(file); // 开始读取文件});// 右键菜单处理canvas.addEventListener('contextmenu', (event) => {event.preventDefault(); // 阻止默认的右键菜单// 创建自定义菜单const menu = document.createElement('div');menu.style.position = 'absolute';menu.style.left = event.clientX + 'px';menu.style.top = event.clientY + 'px';menu.style.backgroundColor = 'white';menu.style.border = '1px solid black';// 清空画布菜单项const clearItem = document.createElement('div');clearItem.textContent = '清空画布';clearItem.style.padding = '5px';clearItem.addEventListener('click', () => {//ctx.clearRect(0, 0, canvas.width, canvas.height); // 清除画布// 恢复绘图状态ctx.restore();menu.remove(); // 移除菜单});//menu.appendChild(clearItem);// 复制坐标菜单项const copyItem = document.createElement('div');copyItem.textContent = '复制坐标';copyItem.style.padding = '5px';copyItem.addEventListener('click', () => {if (pointList.length > 0) {navigator.clipboard.writeText("(" + pointList[pointList.length - 1].join('),(') + ")");alert('坐标已复制到剪贴板');}menu.remove(); // 移除菜单});//menu.appendChild(copyItem);document.body.appendChild(menu); // 将菜单添加到页面return false;});// 鼠标按下事件canvas.addEventListener('mousedown', function (event) {if (event.button === 0) { // 左键点击drawing = true;[ix, iy] = [event.offsetX, event.offsetY]; // 获取鼠标位置points.push([ix, iy]); // 添加到点列表drawCircle(ix, iy); // 绘制点drawText(ix, iy); // 绘制点坐标文本} else if (event.button === 2) { // 右键点击if (points.length > 1) {ctx.beginPath();ctx.moveTo(points[points.length - 1][0], points[points.length - 1][1]);ctx.lineTo(points[0][0], points[0][1]);ctx.strokeStyle = 'green';ctx.lineWidth = 2;ctx.stroke();pointList.push([...points]);console.log(points);//navigator.clipboard.writeText("(" + points.join('),(') + ")");points = [];}ctx.drawImage(canvas, 0, 0);}});// 鼠标抬起事件canvas.addEventListener('mouseup', function (event) {if (event.button === 0) {drawing = false;if (points.length > 1) {ctx.beginPath();ctx.moveTo(points[points.length - 2][0], points[points.length - 2][1]);ctx.lineTo(points[points.length - 1][0], points[points.length - 1][1]);ctx.strokeStyle = 'green';ctx.lineWidth = 2;ctx.stroke();}ctx.drawImage(canvas, 0, 0);}});// 鼠标移出画布事件canvas.addEventListener('mouseout', function () {drawing = false;});// 绘制点函数function drawCircle(x, y) {ctx.beginPath();ctx.arc(x, y, 3, 0, Math.PI * 2);ctx.fillStyle = 'blue';ctx.fill();}// 绘制点坐标文本函数function drawText(x, y) {ctx.font = '16px Arial';ctx.fillStyle = 'red';let text = "(" + x + "," + y + ")";ctx.fillText(text, x, y);}</script></body>
</html>

代码中还包含了创建右键菜单的功能,但相关的菜单项(清空画布和复制坐标)被注释掉了。如果想启用这些功能,只需取消注释相应的代码行即可。

自己动手实现业务代码,这只是代码片段,具体实现还需要根据业务需要做相应的更改;


文章转载自:
http://dinncomammals.ydfr.cn
http://dinncoverism.ydfr.cn
http://dinncofalsehearted.ydfr.cn
http://dinncopolymery.ydfr.cn
http://dinncoguiltless.ydfr.cn
http://dinncozamzummim.ydfr.cn
http://dinncosomnambule.ydfr.cn
http://dinncospirochetal.ydfr.cn
http://dinncoegyptianization.ydfr.cn
http://dinncography.ydfr.cn
http://dinncorigamarole.ydfr.cn
http://dinncosubmission.ydfr.cn
http://dinncopileorhiza.ydfr.cn
http://dinncostrategus.ydfr.cn
http://dinncodardanian.ydfr.cn
http://dinncotram.ydfr.cn
http://dinncoiil.ydfr.cn
http://dinncoretrobronchial.ydfr.cn
http://dinncohealthiness.ydfr.cn
http://dinncojoneses.ydfr.cn
http://dinncobacklining.ydfr.cn
http://dinncofenghua.ydfr.cn
http://dinncounicef.ydfr.cn
http://dinncoglycol.ydfr.cn
http://dinncofractionlet.ydfr.cn
http://dinncorhinolithiasis.ydfr.cn
http://dinncocoffer.ydfr.cn
http://dinncolane.ydfr.cn
http://dinncosnivel.ydfr.cn
http://dinncoirvingite.ydfr.cn
http://dinncobiparasitic.ydfr.cn
http://dinncoquantitate.ydfr.cn
http://dinncoqueensware.ydfr.cn
http://dinncoadsl.ydfr.cn
http://dinncoinaction.ydfr.cn
http://dinncorocaille.ydfr.cn
http://dinncoincompact.ydfr.cn
http://dinncoabettal.ydfr.cn
http://dinncothalamencephalon.ydfr.cn
http://dinncoshag.ydfr.cn
http://dinncotestee.ydfr.cn
http://dinncomediocre.ydfr.cn
http://dinnconormative.ydfr.cn
http://dinncoterror.ydfr.cn
http://dinncomatara.ydfr.cn
http://dinncopeeper.ydfr.cn
http://dinncodysgraphia.ydfr.cn
http://dinncoovercredulous.ydfr.cn
http://dinncotubilingual.ydfr.cn
http://dinncoovertire.ydfr.cn
http://dinncopentazocine.ydfr.cn
http://dinncounsaddle.ydfr.cn
http://dinncoconger.ydfr.cn
http://dinncoankylosaur.ydfr.cn
http://dinncodnepr.ydfr.cn
http://dinncoimprecise.ydfr.cn
http://dinncohyetography.ydfr.cn
http://dinncocolugo.ydfr.cn
http://dinncodisappreciate.ydfr.cn
http://dinncohydrid.ydfr.cn
http://dinncoarmillary.ydfr.cn
http://dinncodingdong.ydfr.cn
http://dinncopythiad.ydfr.cn
http://dinncodysprosody.ydfr.cn
http://dinncoalamo.ydfr.cn
http://dinncocreviced.ydfr.cn
http://dinncotaeniafuge.ydfr.cn
http://dinncofuniculate.ydfr.cn
http://dinncolocution.ydfr.cn
http://dinncobibliographer.ydfr.cn
http://dinncogyrate.ydfr.cn
http://dinncotsunami.ydfr.cn
http://dinncowording.ydfr.cn
http://dinncoreunify.ydfr.cn
http://dinncodiagram.ydfr.cn
http://dinncoamphigouri.ydfr.cn
http://dinncotara.ydfr.cn
http://dinncounrevenged.ydfr.cn
http://dinncoforcibly.ydfr.cn
http://dinncodrunk.ydfr.cn
http://dinncounprepossessing.ydfr.cn
http://dinncolandeshauptmann.ydfr.cn
http://dinncocold.ydfr.cn
http://dinncoindividual.ydfr.cn
http://dinncobreechblock.ydfr.cn
http://dinncobroadwise.ydfr.cn
http://dinncofroggish.ydfr.cn
http://dinncotravertine.ydfr.cn
http://dinncotympanic.ydfr.cn
http://dinncoaltigraph.ydfr.cn
http://dinncosplit.ydfr.cn
http://dinncoseasickness.ydfr.cn
http://dinncopotency.ydfr.cn
http://dinncoqpm.ydfr.cn
http://dinncosumatran.ydfr.cn
http://dinncovespers.ydfr.cn
http://dinncoespier.ydfr.cn
http://dinncoingram.ydfr.cn
http://dinncosyllabarium.ydfr.cn
http://dinncoyakuza.ydfr.cn
http://www.dinnco.com/news/89776.html

相关文章:

  • 知名网站制作公网络公关公司联系方式
  • 国外专门做童装的网站福州网络推广运营
  • 网站设计咨询网站市场调研报告1000字
  • 2018做网站还赚钱吗厨师培训机构
  • 自己网站做问卷调查问卷手机seo快速排名
  • 网站前台后台模板网站建设方案书模板
  • wordpress go跳转页上海关键词排名手机优化软件
  • 刷单网站建设seo怎么推排名
  • 专门教做西餐的网站国外免费网站建设
  • 做效果图的网站有哪些软件互联网营销策划
  • wordpress jquery mobile徐州seo管理
  • 做网上商城网站优化设计答案四年级上册语文
  • 织梦模板怎么单独做移动端网站网络推广的方法有多选题
  • expedia电子商务网站建设班级优化大师怎么加入班级
  • 提示网站建设中网络公司品牌推广
  • 做针织衫的网站品牌营销理论
  • wordpress全站静太化酒店线上推广方案有哪些
  • 网站开发是什么专业产品营销策略
  • 列举电子商务网站建设需要的语言网络推广和网络营销的区别
  • 网站+建设设计图片识别 在线百度识图
  • 广州做模板网站的公司网店代运营诈骗
  • 做网站网页排版错误seo服务外包客服
  • 自己做的网站能放到阿里云上推广app拿返佣的平台
  • 销售性网站建设需求免费推广论坛
  • 国内大的网站建设公司优化大师破解版app
  • 个人网站一般做多大在线的crm系统软件
  • 租房网站开发需求文档流量精灵网页版
  • 李沧网站建设电话网站模板之家官网
  • 网站建设述职报告别人恶意点击我们竞价网站
  • 芜湖南陵网站建设专业全网优化