|
Java Screen Grabber 
By Bobby on Thu, 1 Jan 2009 07:07:21 +0000
:
java,
attach,
jpeg,
screenshot,
hex,
The Java screen grabber is another "proof of concept" i found myself working on. The goal is to be able to allow a user to capture and paste screenshots directly from the clipboard and into a page (no file-input field, no saving of screenshot into a temp file to upload).
Demo
Here is a demo of the screen grabber. It requires the JRE 5+. You will see a certificate prompt because the Java applet has to be signed in order to be able to access restricted resources such as the system clipboard and file system.
Implementation
Java provides the bulk of the functionality (and is required, it's not something that can be accomplished with Flash or Silverlight, for example, on the other hand ActiveX would also do the trick - but not in a cross-platform manner). The Java applet accesses the image data on the clipboard, compresses it to JPEG, and saves it to a temporary folder on the user's desktop.
The key is to be able to get around using the HTML file input field (to save the user some work). What happens is that the Java applet converts the image's bytes into HEX (HEX is safe to upload because it consists of readable ASCII characters), and then passes the HEX string (in chunks) to javascript, via some java-to-javascript communication. The HEX data is then posted to the server and the image reassembled. (Note that the HEX string will be twice as large as the image file).
(see all)
web service, tile engine, google docs, flash, window, penn, pixel, python, game, compiler, server, tlslite, token, reference, rtmp, vmware, p vs np, Google Docs, poweredge, javascript, component, vbulletin, proxy, networking, vmware esxi, GData, forum, plugin, gwt, outlook, scales, puzzle, GWT, java, attach, shining force, subsets, appengine, permutations, pong, authentication, roland, screenshot, np-complete, gdata, neural net, php, latex, audio, AppEngine
|