It would need a callback for when the view changed so it could redraw
I guess the advantage to having a second canvas, rather than drawing directly on the OSD canvas, is it can stay unchanged when the viewport remains the same (even if OSD is repainting due to new tiles coming in)
You could also auto shift (and even zoom ) the contents of the overlay canvas in anticipation of actual redraws if you wanted to
i.e. if the user pans left 20px, you can shift the canvas contents left 20px and then all you need to redraw is the right 20px strip
That could make a big performance difference in a scenario where you're talking about drawing thousands of objects
Well, there is resize and there is zoom. You definitely need to redraw the canvas when you resize the viewer, but theoretically that won't happen too frequently. When you zoom you can scale the image on the canvas but also let the app redraw as needed.
Or maybe for starters the best approach is ask the app to redraw always
At any rate, it should be a matter of calling a callback or sending an event so the app (i.e. the user of your plugin's API) can do whatever it needs
Trying to get started with OSD. I have a bunch of hdv.xml files and image pyramids I used with the silverlight viewer and created with HDMake . Can I use them with OSD? Also, I found a section called "Getting Started" on the github site, but is there something a little more hand-holdy?