chickadee » s9fes-char-graphics » with-output-to-canvas

with-output-to-canvas THUNKprocedure

Returns a canvas from the read output of THUNK. Useful for the result capture of other character graphics output as a canvas.

THUNK
(-> void) : writes to current-output-port.
  • Capture a plot:
(define *data* '(0 1 2 3 4 5 6 7 8 9))
(define data-plot (lambda () (char-plot *data* 'data 7 35 #f)))
(define data-plot-image (canvas->image (with-output-to-canvas data-plot)))