Reputation: 1711
How would I go about exporting a Racket pict as an image file I can use on a web page?
(any html-capable format or data-uri would do)
Upvotes: 5
Views: 681
Reputation: 31145
#lang racket
(require pict)
(define (save-pict the-pict name kind)
(define bm (pict->bitmap the-pict))
(send bm save-file name kind))
(save-pict (standard-fish 200 200) "fish.png" 'png)
This saves an image in "fish.png".
Upvotes: 9