I am using react-konva to work with images on a canvas. Now almost everything is working, except that I want to download part of the canvas as image.
I have look at the docs react-konva and it seems I can only download the whole canvas as image or use an external library to export to a pdf (which does allow me to set a specific location and size). But that is not an image.
I want to be able to give a specific location and size of the canvas to generate an image.
Please help.
You can export part of the canvas. When you get reference to the
Konva.Stage
instance you can usestage.toDataURL()
method for export. That method has arguments to control position and size: