Created
September 7, 2010 20:42
-
-
Save Serabe/569061 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn display-fn | |
"Just a function for displaying images" | |
[img] | |
(let [frame (JFrame. "Untitled Image") | |
size (Dimension. (:width img) (:height img))] | |
(do | |
(doto frame | |
(.setDefaultCloseOperation WindowConstants/DISPOSE_ON_CLOSE) | |
;(.setResizable false) | |
(.setLayout (BorderLayout.)) | |
(.setSize size) | |
(.pack)) | |
(doto (.getGraphics (.getRootPane frame)) | |
(.drawImage (:img img) 0 0 (:width img) (:height img) nil) | |
(.dispose)) | |
(doto frame | |
(.pack) | |
(.show))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment