Open Insiyaa opened 5 years ago
I'm not really familiar with this plugin, but you should figure out what coordinate system rect
is in. See http://openseadragon.github.io/examples/viewport-coordinates/ for an overview of the OSD coordinate systems.
I think it might be in image coordinates, in which case you'll need to convert it to web coordinates before accessing the canvas directly. Furthermore, if you're on an HDPI screen (where the pixel density is anything other than 1) you'll need to compensate for that. For instance if your pixel density is 2, you'll need to multiply by 2 to get the actual canvas coordinates. To find the pixel density, use OpenSeadragon.pixelDensityRatio
.
Have you solved it? I also encountered the same problem, how can I solve it?
Try setting returnPixelCoordinates to false. Then convert the coordinates using viewer.viewport.viewportToViewerElementRectangle(rect).
Source: https://github.com/picturae/openseadragonselection/issues/7
The selected image obtained is shifted as shown in images below.
The code I used is as follows: