We can actually display the image we fetched :)
This commit is contained in:
parent
360550a6a9
commit
8ceb7bce2a
1 changed files with 7 additions and 1 deletions
|
|
@ -105,10 +105,16 @@
|
|||
;; first multipart alternative to a `BufferedImage` that we can use
|
||||
;; with Clojure2d.
|
||||
|
||||
(require '[clojure2d.core :as c2d])
|
||||
|
||||
(defn byte-array->image [bs]
|
||||
(with-open [in (java.io.ByteArrayInputStream. bs)]
|
||||
(javax.imageio.ImageIO/read in)))
|
||||
|
||||
(def img (byte-array->image (:body first-multipart-chunk)))
|
||||
(def canvas (c2d/canvas (c2d/width img) (c2d/height img)))
|
||||
|
||||
(require '[clojure2d.core :as c2d])
|
||||
(c2d/with-canvas [c canvas]
|
||||
(c2d/image c img))
|
||||
|
||||
(c2d/show-window canvas "Hello World")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue