Advertisement
Guest User

Untitled

a guest
Oct 15th, 2008
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 1.09 KB | None | 0 0
  1. #lang scheme
  2. (require scheme/gui)
  3. (require slideshow)
  4.  
  5. (define (make-motivator pict label description)
  6.   (let ([motiv
  7.          (colorize
  8.           (vc-append
  9.            (cc-superimpose
  10.             (linewidth 2 (rectangle (+ (pict-width pict) 8) (+ (pict-height pict) 8))) pict)
  11.            (text label 'roman 40)
  12.            (text description 'roman 24))
  13.           "white")
  14.          ])
  15.     (cc-superimpose
  16.      (colorize (filled-rectangle (+ (pict-width motiv) 50) (+ (pict-height motiv) 50)) "black")
  17.      motiv)))
  18.  
  19. (define (get-param name)
  20.   (begin
  21.     (display name)
  22.     (read-line)))
  23.  
  24. (define (make-motivator/interactive)
  25.   (make-motivator (bitmap (path->string (get-file))) (get-param "Label: ") (get-param "Description: ")))
  26.  
  27. (define (save-motivator pict name kind)
  28.   (let* ([bmp (make-object bitmap% (inexact->exact (floor (pict-width pict))) (inexact->exact (floor (pict-height pict))))]
  29.          [dc (make-object bitmap-dc% bmp)])
  30.     (begin
  31.       (draw-pict pict dc 0 0)
  32.       (send bmp save-file name kind))))
  33.  
  34. (save-motivator (make-motivator/interactive) (put-file) 'png)
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement