pict: improve error for failure in pict->bitmap

Closes PR 14563
This commit is contained in:
Matthew Flatt 2014-06-12 07:42:12 +01:00
parent 71bbe6ca9c
commit 8c1d4af684

View File

@ -214,6 +214,14 @@
(define h (pict-height p))
(define bm (make-bitmap (max 1 (inexact->exact (ceiling w)))
(max 1 (inexact->exact (ceiling h)))))
(unless (send bm ok?)
(error 'pict->bitmap
(string-append "bitmap creation failed\n"
" possible reason: out of memory\n"
" pict width: ~a\n"
" pict height: ~a")
w
h))
(define dc (make-object bitmap-dc% bm))
(send dc set-smoothing smoothing)
(draw-pict p dc 0 0)