How do I access the clipboard image from the browser?

3

Does anyone have any idea how to access the image that is in the clipboard when we give a Print Screen on any screen? What I need is to have access to the image by giving ctrl + v to the browser, just like this application works: link

The code I got for the event is this, and it works, however how do I access the image from this point?

$(document).bind('paste', function (evt) {
   alert('ctrl + V funciona');
});

Detail: browser: Google Chrome

    
asked by anonymous 03.06.2014 / 16:02

1 answer

0

I found this plugin link

It worked perfectly for my purpose, for copying texts and images.

Just include the .js file and use the code below.

paste = $.paste().appendTo('body');
paste.on('pasteImage', function (ev, data){
console.log("dataURL: " + data.dataURL)
});
paste.on('pasteText', function (ev, data){
console.log("text: " + data.text)
});
paste.focus(); // it's actually a hidden div element

// ... when you don't need it anymore
paste.remove();

examples and more information on the link.

    
04.06.2014 / 13:45