问题
I see that this has been discussed a few times before, but that was 2010 and before. Now i was writing a new email in my gmail client and noted that i could just paste an image into the mail body / webform.
I was quite happy to see this as i have been looking for a similar solution for a while.
Can anyone provide some details on how this works? Is it Flash? Or some JavaScript?
回答1:
It is html5 + javascript, and or flash (depends on the browser) This link should get you strated: http://strd6.com/2011/09/html5-javascript-pasting-image-data-in-chrome/
A little warning though, this only works in chrome as of now.
回答2:
Here is another alternative, inspired by Github's image paste. Seems to work with jQuery.
https://github.com/Rovak/InlineAttachment

回答3:
This link might be a great starting point for Chrome + Firefox:
http://joelb.me/blog/2011/code-snippet-accessing-clipboard-images-with-javascript/
(from the guy who built Pasteboard)
With IE, it sounds like you might need to resort to HTA, ActiveX, Flex, or Java. Have a look here:
Take a screenshot of a webpage with JavaScript?
来源:https://stackoverflow.com/questions/10251528/paste-image-from-clipboard-to-web-form