0

I rendered konva stage with 2 images overlapping each other. Now, I am trying to export the overlapped image from the stage and canvas. I tried to get const dataURL = this.stageNode.getStage().toDataURL(); and added stageNode like

 <Stage ref={node => {
      this.stageNode = node;
    }}>

But still I am not able to access base64 string from stage. A trail with react kova image sample

PS:This is related to https://github.com/konvajs/react-konva/issues/305 to some extent

Community
  • 1
  • 1
Samdeesh
  • 905
  • 11
  • 23
  • Do you have any errors? Can you make an online demo of what you are trying? – lavrton Dec 24 '18 at 13:49
  • getting a warning: Konva warning: Unable to get data URL. Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. Added my code at https://codesandbox.io/s/zr3r3lr3l4 – Samdeesh Dec 25 '18 at 09:28
  • You have a blank URL, because you have CORS issue. https://stackoverflow.com/questions/22710627/tainted-canvases-may-not-be-exported – lavrton Dec 25 '18 at 14:04

1 Answers1

0

Using images from same domain solves the issue which was faced, could not implement the fix in online demo. Thanks @lavrton for prompt reply

Samdeesh
  • 905
  • 11
  • 23