improved the error message for save-image

closes PR 11076
This commit is contained in:
Robby Findler 2010-08-20 17:20:07 -05:00
parent 32f1f1d8f1
commit f1e38247e0
2 changed files with 7 additions and 4 deletions

View File

@ -57,9 +57,8 @@
[parent bp]) min-width 100) [parent bp]) min-width 100)
(send f show #t))) (send f show #t)))
(define (save-image pre-image filename) (define/chk (save-image image filename)
(let* ([image (to-img pre-image)] (let* ([bm (make-object bitmap%
[bm (make-object bitmap%
(inexact->exact (ceiling (+ 1 (get-right image)))) (inexact->exact (ceiling (+ 1 (get-right image))))
(inexact->exact (ceiling (+ 1 (get-bottom image)))))] (inexact->exact (ceiling (+ 1 (get-bottom image)))))]
[bdc (make-object bitmap-dc% bm)]) [bdc (make-object bitmap-dc% bm)])

View File

@ -1532,7 +1532,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; test that the extra mode check is there ;; test errors.
;; mostly test that the extra mode check is there
;; ;;
(test/exn (rectangle 10 10 "solid" (make-pen "black" 12 "solid" "round" "round")) (test/exn (rectangle 10 10 "solid" (make-pen "black" 12 "solid" "round" "round"))
@ -1588,6 +1589,9 @@
=> =>
#rx"^polygon: expected <image-color>") #rx"^polygon: expected <image-color>")
(test/exn (save-image "tri.png" (triangle 50 "solid" "purple"))
=>
#rx"^save-image:")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;