Solved, thanks for the comment, the .a9s-annotationlayer seems to be a svg strings but not actually a canvas, so there is no straight forward way to combine them. so basically it need to extract the annotation in the view and convert the annotation coordinate from image to windows px coordinate then draw on a hidden canvas, after than could use the drawImage to overlay this to the original image.
","upvoteCount":1,"url":"https://github.com/orgs/annotorious/discussions/524#discussioncomment-12495152"}}}output the snapshot of the image/annotation #524
-
|
I am trying to make a button to take a snapshot of the current view with the annotation, use the following code only take the snapshot of the image but not the annotation, any idea of how to do that, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
The annotations are on a second canvas, placed on top of (and kept in sync with) the OpenSeadragon drawer canvas. Snapshotting the annotation canvas should work pretty much the same way. (You could simply grab it via a query selector. Something like How to merge both canvases is a different question. I haven't done that myself yet. But the Annotorious canvas is transparent. So perhaps doing a |
Beta Was this translation helpful? Give feedback.
-
|
Solved, thanks for the comment, the .a9s-annotationlayer seems to be a svg strings but not actually a canvas, so there is no straight forward way to combine them. so basically it need to extract the annotation in the view and convert the annotation coordinate from image to windows px coordinate then draw on a hidden canvas, after than could use the drawImage to overlay this to the original image. |
Beta Was this translation helpful? Give feedback.
Solved, thanks for the comment, the .a9s-annotationlayer seems to be a svg strings but not actually a canvas, so there is no straight forward way to combine them. so basically it need to extract the annotation in the view and convert the annotation coordinate from image to windows px coordinate then draw on a hidden canvas, after than could use the drawImage to overlay this to the original image.