[plt-scheme] 2htdp/image Images in Slideshow

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue May 25 16:59:41 EDT 2010

You can do this:

#lang scheme
(require slideshow slideshow/code)

(require (prefix-in im: 2htdp/image)
         mrlib/image-core)

(define (image->pict img)
  (dc (λ (dc dx dy) (render-image img dc dx dy))
      (im:image-width img)
      (im:image-height img)))

(slide
 (hbl-append (code (rectangle 15 25 "solid" "blue"))
             (t "=>")
             (image->pict (im:rectangle 15 25 "solid" "blue"))))

I see that render-image isn't documented, tho. Apologies for that.

Robby

On Tue, May 25, 2010 at 2:45 PM, Nadeem Abdul Hamid <nadeem at acm.org> wrote:
>
> How can one embed images generated using 2htdp/image into a slideshow? Is there an easy tweak to make something like this work:
>
> (require (prefix-in im: 2htdp/image))
> (slide
>  (hbl-append (code (rectangle 15 25 "solid" "blue")) (t "=>")  (im:rectangle 15 25 "solid" "blue"))
>  )
>
> --- nadeem
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.