海龙ajax修复坐标系统
我正在尝试使用 Seadragon Ajax 和坐标系统,以便在我的网站上显示大分辨率的大图像。 我想查看该图像的一部分,知道它们的坐标。问题是,当我缩放或拖动图像时,坐标不再对应于图像的同一部分。 我尝试使用一些代码,但没有办法。我需要修复所有图像的坐标系统。 我能做什么? 谢谢
I'm trying Seadragon Ajax with coordinates system in order to show in my website large images with big resolution .
I would to view a part of this image knowing their coordinates. The problem is that when I make zoom or drag the image , coordinates no longer correspond to the same part of the image.
I try with some code but no way.I need that coordinates system is fix for all the image .
As i can do?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,没问题。您必须将“真实”基于像素的坐标转换为海龙点坐标。
“Seadragon Ajax 使用标准化坐标系。图像的左上角始终位于原点 (0, 0),而图像的宽度始终为 1。图像的高度取决于宽高比,因此高为宽一半的图像的高度为 0.5"
因此,如果您知道图像的尺寸为 500x500px,则点 1,1 = 500px,500px 并且0.5,0.5 = 250 像素,250 像素。
通过编写如下函数进行转换:
Sure, no problem. You have to transform the "real" pixelbased coordinate to the seadragon point-coordinate.
"Seadragon Ajax uses a normalized coordinate system. The top-left of the image is always at the origin (0, 0) while the width of the image is always 1. The height of the image is dependant on the aspect ratio, so an image which is half as tall as it is wide will have a height of 0.5"
So, if you know that your image is 500x500px, then point 1,1 = 500px,500px and 0.5,0.5 = 250px,250px.
Convert by writing a function like this: