Skip to content

Instantly share code, notes, and snippets.

View brundonsmith's full-sized avatar

Brandon Smith brundonsmith

View GitHub Profile
@fdb
fdb / simple-bitmap-image.clj
Created July 5, 2012 21:12
Writing a bitmap image in Clojure
; This example shows how to write a bitmap image using Clojure
; Import the necessary classes.
(import 'java.awt.image.BufferedImage 'javax.imageio.ImageIO 'java.awt.Color 'java.io.File)
; Create a new image with a 100x100 size. The image is going to have four color channels.
(def img (BufferedImage. 100 100 BufferedImage/TYPE_INT_ARGB))
; Draw on the image by getting the graphics object and invoking methods on it.
(doto (.getGraphics img)