1

I'm building some drag and drop Javascript app using konva.js and I have this one problem: when i'm exporting the image using the "stage.toDataURL()" command, the exported image contains the resizing boundings: see attached picture How can i export the image without the resize bounding lines?

Thanks

2 Answers2

2

Just hide transformer before export, then show it back.

tranformer.hide();
const url = stage.toDataURL():
tranformer.show();
lavrton
  • 18,973
  • 4
  • 30
  • 63
1

You can create two layers:

  • First layer with nodes
  • Second node with transformers

Once you need screenshot without transformers, just use .toDataURI on First layer

Layer api: https://konvajs.org/api/Konva.Layer.html

React Screenshot

Mark K
  • 31
  • 1
  • 2