简体   繁体   English

如何在木瓜中管理缩放和长度手柄

[英]how to manage zoom and length handle in papaya

What I want to do is 我想做的是

1) I want to draw a length on image and want to add handle to edit it. 1)我想在图像上绘制一个长度,并想添加手柄以对其进行编辑。

2) When I want to zoom the image the drawn length should match the zoom level. 2)当我要缩放图像时,绘制的长度应与缩放级别匹配。

ctx.beginPath();
            ctx.moveTo(linearr[i].x1, linearr[i].y1);
            ctx.lineTo(linearr[i].x2, linearr[i].y2);
            ctx.closePath();
            ctx.stroke();

            ctx.beginPath();
            ctx.arc(linearr[i].x1, linearr[i].y1, 2, 0, Math.PI * 2, true);
            ctx.closePath();
            ctx.fillStyle = 'green';
            ctx.fill();
            ctx.stroke();

            ctx.beginPath();
            ctx.arc(linearr[i].x2, linearr[i].y2, 2, 0, Math.PI * 2, true);
            ctx.closePath();
            ctx.fillStyle = 'green';
            ctx.fill();
            ctx.stroke();

where linearr is an array 其中linearr是一个数组

Papaya already supports a ruler tool , if that's what you're looking for. 如果您正在寻找的话,Papaya已经支持标尺工具

Otherwise, see the function papaya.viewer.Viewer.prototype.drawRuler() for an example of how to use the screen transform to draw lines, which includes the zoom transform. 否则,请参见函数papaya.viewer.Viewer.prototype.drawRuler()以获取有关如何使用屏幕变换绘制线条(包括缩放变换papaya.viewer.Viewer.prototype.drawRuler()的示例。 Another function that might be helpful to you is this.selectedSlice.findProximalRulerHandle() . 另一个可能对您有帮助的函数是this.selectedSlice.findProximalRulerHandle()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何显示特定的dicom图像(木瓜)? - How to display a specific dicom image (Papaya)? 如何在木瓜查看器中使用平移工具 - how to use pan tool in papaya viewer 如何使用Papaya在JavaScript中使用多个DICOM文件创建表面文件? - How can I create a surface file using multiple DICOM files in JavaScript using Papaya? 如何处理Node.js缓冲区(长度不确定) - How to handle nodejs buffer (uncertain length) 如何处理固定位置元素的“滚动”和“缩放”事件? - How to handle “scroll” and “zoom” event for fixed-positioned element? javascript:移动设备上的插页式广告-您如何处理缩放? - javascript: interstitial ads on mobile - how do you handle zoom? 木瓜Dicom查看器片段显示相反顺序 - Papaya Dicom viewer slices are showing reverse order 不变地更新对象数组并管理长度减少 - Update array of objects immutably and manage length redux 当放大浏览器导致一个 div 容器扩展时,如何调整其他 div 容器的长度以保持在同一底线? - when zoom in browser cause one div container expand, how to adjust other div container length to keep the at a same bottom line? 如何在没有冗余的方法中处理长度为1且大于1的对象 - How to handle objects with length of one and greater than one in a method without redunancy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM