L K
L K

Reputation: 1

Accessing/Setting Scale factors in OpenSeadragon

I'm a complete html/css/js newbie and I've been using the demo here https://github.com/altert/OpenSeadragonCanvasOverlay/ as a base for trying out OpenSeadragon. I'm trying to see and manage the scale factors (the ratio between the numbers I'm using for the overlay : the pixels of the image : viewport coordinates etc.). But I'm getting confused between all the numbers and class attributes that OpenSeadragon has, even after looking at their documentation.

When I first cloned the repository linked above and tried out the demo.html without changing anything, I found that the rectangle given by:

overlay.context2d().fillRect(0, 0, 500, 500);

was way too big, going way past the bounds of the actual image. I had to bring it down from 500 to around 0.25 to have a overlay with a similar size to the overlay in the linked demo: https://altert.github.io/OpenSeadragonCanvasOverlay/demo.html. When I did a console.log(this.viewer); after this.viewer was initialized, I found that the _homeBounds member had the max/min of whatever coordinate system I was using. How would I know how these _homeBounds values relate to pixel size? Is there a scale factor member somewhere? How would I change this scale factor?

Any help is much appreciated!

Upvotes: 0

Views: 35

Answers (0)

Related Questions