The following functions perform a screenshot, or capture a region of the screen, and then provide a method to display the captured image in a new window or load/save to disk.
Note: I'd like to thank hoeck (from the Clojure IRC channel) for writing the display-image function.
"Displays an image in a new window"
(let [frame (doto (javax.swing.JFrame. "Display Image")
(.setBounds 0 0 (. image getWidth) (. image getHeight))
cv (proxy [java.awt.Canvas] 
(paint [g] (. g drawImage image nil nil))
(update [g] (. g drawImage image nil nil)))]
(.add (.getContentPane frame) cv)))
"Captures an image of a section of the primary screen"
[from-x from-y x-size y-size]
(let [rob (java.awt.Robot.)
rect (java.awt.Rectangle. from-x from-y x-size y-size)]
(. rob createScreenCapture rect)))
"Returns an image of the entire primary screen"
(let [my-scr (.. java.awt.Toolkit (getDefaultToolkit) (getScreenSize))]
(capture-image 0 0 (. my-scr width) (. my-scr height))))
"Save an image to disk as jpg"
(javax.imageio.ImageIO/write image "jpg" (java.io.File. filename))
"Read a jpg from disk"
(javax.imageio.ImageIO/read (java.io.File. filename)))