retrieve image from clipboard
HI
I want to get an image from the system clipboard (Windows/Mac) and paste it int开发者_StackOverflow中文版o can it be done in javascript?
No, JavaScript would not be able to paste image data into a web page. There are no HTML elements that can display pasted image data.
If there's a way to grab the data URI (I can't figure out how, can you? it seems only text is available from the clipboard) then you could append <img src="data:image/png;base64,9A8SDF7ADSF9==">
to a wysiwyg field where the gobbledygook is the data URI. Then assuming you want to save that, you'd have to do some parsing on submit, write the image to a file and do with it as you will, or store as a blob or something.
精彩评论