Load image(maby a jpg) to a image-buffer.

42 views
Skip to first unread message

Andreas Olsson

unread,
Mar 21, 2016, 4:35:08 PM3/21/16
to seesaw-clj
Trying to import an image to a image-buffer but having trouble solving it.

heres a try:

(def pic  (seesaw.graphics/buffered-image 200 200))
          
(def dopic  (.imageio.ImageIO.read pic (str  (System/getProperty "user.dir") "\\resources\\grumpy.jpg")))

Am I totaly of??

Dave Ray

unread,
Mar 21, 2016, 6:57:49 PM3/21/16
to seesa...@googlegroups.com
Something like this should work if I understand what you're going for:

(def pic (javax.imageio.ImageIO/read (java.io.File. "/path/to/file.jpg")))

See https://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html#read%28java.io.File%29

Dave


--
You received this message because you are subscribed to the Google Groups "seesaw-clj" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seesaw-clj+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Olsson

unread,
Mar 22, 2016, 2:21:59 AM3/22/16
to seesaw-clj
Thank you, I´m not coming from java so it´s hard sometimes.:-)

I think Seesaw is great but the Seesaw API docs needs an update. Need help with that?
Reply all
Reply to author
Forward
0 new messages