mk-img.rkt (643B)
1 #lang racket/base 2 (require "main.rkt" racket/draw slideshow/pict racket/class) 3 4 (define the-margin 32) 5 6 (define the-pict (let ([p (langs-pict #t)]) 7 (scale p (/ (- 1024 the-margin) (pict-width p))))) 8 (pict-width the-pict) 9 (define bm (make-object bitmap% 10 (+ the-margin (ceiling (inexact->exact (pict-width the-pict)))) 11 (+ the-margin (ceiling (inexact->exact (pict-height the-pict)))))) 12 (define bdc (make-object bitmap-dc% bm)) 13 (send bdc set-smoothing 'aligned) 14 (send bdc clear) 15 (draw-pict the-pict bdc (/ the-margin 2) (/ the-margin 2)) 16 (send bdc set-bitmap #f) 17 (send bm save-file "langs.png" 'png)