Skip to content

Instantly share code, notes, and snippets.

@emidln
Created January 22, 2016 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emidln/555c96a26dab2483c671 to your computer and use it in GitHub Desktop.
Save emidln/555c96a26dab2483c671 to your computer and use it in GitHub Desktop.
(defn display-image
[image]
(let [frame (doto (javax.swing.JFrame. "Display Image")
(.setBounds 0 0 (.getWidth image) (.getHeight image))
(.setVisible true))
canvas (proxy [java.awt.Canvas] []
(paint [g] (.drawImage g image nil nil))
(update [g] (.drawImage g image nil nil)))]
(.add (.getContentPane frame) canvas)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment