14 Rendering
parameter
(dc-for-text-size) → (or/c #f (is-a?/c dc<%>))
(dc-for-text-size dc) → void? dc : (or/c #f (is-a?/c dc<%>))
The drawing context installed in this parameter need not be the same as the ultimate drawing context, but it should measure text in the same way. Under normal circumstances, font metrics are the same for all drawing contexts, so the default value of dc-for-text-size is a bitmap-dc% that draws to a 1-by-1 bitmap.
parameter
→ (list/c (>=/c 0) (>=/c 0) (>=/c 0) (>=/c 0)) (convert-bounds-padding padding) → void? padding : (list/c (>=/c 0) (>=/c 0) (>=/c 0) (>=/c 0))
Added in version 1.2 of package pict-lib.
procedure
pict : pict-convertible? dc : (is-a?/c dc<%>) x : real? y : real?
procedure
(pict->bitmap pict [smoothing]) → (is-a?/c bitmap%)
pict : pict-convertible? smoothing : (or/c 'unsmoothed 'smoothed 'aligned) = 'aligned
When drawing the pict into the bitmap using the smoothing mode smoothing (see set-smoothing for more information on smoothing modes).
procedure
(pict->argb-pixels pict [smoothing]) → bytes?
pict : pict-convertible? smoothing : (or/c 'unsmoothed 'smoothed 'aligned) = 'aligned
> (pict->argb-pixels (filled-rectangle 1 1)) #"\377\0\0\0"
> (pict->argb-pixels (colorize (filled-rectangle 1 1) "red")) #"\377\377\0\0"
Added in version 1.1 of package pict-lib.
procedure
(argb-pixels->pict bytes width) → pict?
bytes : bytes? width : exact-nonnegative-integer?
> (let ([b (make-bytes (* 40 40 4) 255)]) (for ([x (in-range (bytes-length b))]) ; when in one of two vertical bands (10-20 & 30-40) (when (or (<= 10 (modulo (quotient x 4) 40) 20) (<= 30 (modulo (quotient x 4) 40) 40)) ; change the red and green fields of the pixel (when (= 1 (modulo x 4)) (bytes-set! b x 0)) (when (= 2 (modulo x 4)) (bytes-set! b x 150)))) (argb-pixels->pict b 40))
Added in version 1.1 of package pict-lib.
procedure
(make-pict-drawer pict)
→ ((is-a?/c dc<%>) real? real? . -> . void?) pict : pict-convertible?
procedure
(show-pict pict [ w h] #:frame-x frame-x #:frame-y frame-y #:frame-style frame-style) → void? pict : pict-convertible? w : (or/c #f exact-nonnegative-integer?) = #f h : (or/c #f exact-nonnegative-integer?) = #f frame-x : (or/c (integer-in -10000 10000) #f) frame-y : (or/c (integer-in -10000 10000) #f)
frame-style :
(listof (or/c 'no-resize-border 'no-caption 'no-system-menu 'hide-menu-bar 'toolbar-button 'float 'metal))
parameter
(current-expected-text-scale scales) → void? scales : (list/c real? real?)