[racket] displaying images frame by frame in the same window in Racket

From: Animesh Pandey (animeshpandey.etno at gmail.com)
Date: Wed Jul 9 05:32:09 EDT 2014

I have three small images of same size. I want to display them one
after another.

(define new1-bitmap
(make-bitmap
 (send bird-bitmap get-width)
 (send bird-bitmap get-height)))

 (define dc-crop
  (new bitmap-dc% [bitmap new1-bitmap]))

 (define f-crop
  (new frame% [label "Random"]))
 (send f-crop show #t)

 (send dc-crop draw-bitmap-section
    bird-bitmap
            0
            0
            0
            (round(* (/ (send bird-bitmap get-height) 3) 2))
            (send bird-bitmap get-width)
            (round(/ (send bird-bitmap get-height) 3)))
 (void
  (new message% [parent f-crop] [label new1-bitmap]))
 (sleep 3)
 (send dc-crop draw-bitmap-section
    new1-bitmap
            0
            0
            0
            (round(/ (send bird-bitmap get-height) 3))
            (send bird-bitmap get-width)
            (round(/ (send bird-bitmap get-height) 3)))
  (void
  (new message% [parent f-crop] [label new1-bitmap]))
  (sleep 3)
  (send dc-crop draw-bitmap-section
    new1-bitmap
            0
            0
            0
            0
            (send bird-bitmap get-width)
            (round(/ (send bird-bitmap get-height) 3)))
(void
 (new message% [parent f-crop] [label new1-bitmap]))

Above is the code that I thought would work. It only take three images and
tries to show them one after another at an interval of 3 seconds. Moreover
the final GUI is three times longer than others.

How should I do this? Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140709/0eda2381/attachment.html>

Posted on the users mailing list.