I have a widget which uses a HTML Canvas tag to hold some drawing, which is drawn by some JS library.
If I right-click on the image, the browser offers the same context menu which is used with normal images: among other things, it offers the possibility to "save image as..."
My question is, can I achieve this from code?
How can I ask the browser the save content of the canvas?
Obviously I can not access the filesystem, but I do not need that: I just want to show the download dialog, which would be shown if the user has chosen "save image as" from the content menu.
Is this possible?
Thank you for your help:
If I right-click on the image, the browser offers the same context menu which is used with normal images: among other things, it offers the possibility to "save image as..."
My question is, can I achieve this from code?
How can I ask the browser the save content of the canvas?
Obviously I can not access the filesystem, but I do not need that: I just want to show the download dialog, which would be shown if the user has chosen "save image as" from the content menu.
Is this possible?
Thank you for your help:
Comment