This file contains hidden or 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
; 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) |