4 Pict Drawing Adjusters
procedure
pict : pict-convertible? factor : real? (scale pict w-factor h-factor) → pict? pict : pict-convertible? w-factor : real? h-factor : real?
The drawing is scaled by adjusting the destination dc<%>’s scale while drawing the original pict.
> (filled-rectangle 80 40) > (scale (filled-rectangle 40 20) 2) > (scale (filled-rectangle 20 20) 4 2)
procedure
(scale-to-fit pict size-pict [#:mode mode]) → pict?
pict : pict-convertible? size-pict : pict-convertible? mode : (or/c 'preserve 'inset 'distort) = 'preserve (scale-to-fit pict width height [#:mode mode]) → pict? pict : pict-convertible? width : real? height : real? mode : (or/c 'preserve 'inset 'distort) = 'preserve
If mode is 'preserve, the width and height are scaled by the same factor so pict’s aspect ratio is preserved; the result’s bounding box may be smaller than width by height. If mode is 'inset, the aspect ratio is preserved as with 'preserve, but the resulting pict is centered in a bounding box of exactly width by height. If mode is 'distort, the width and height are scaled separately.
Changed in version 1.4 of package pict-lib: Added #:mode argument.
procedure
pict : pict-convertible? theta : real?
The bounding box of the resulting pict is the box encloses the rotated corners of pict (which inflates the area of the bounding box, unless theta is a multiple of half of pi). The ascent and descent lines of the result’s bounding box are the horizontal lines that bisect the rotated original lines; if the ascent line drops below the descent line, the two lines are flipped.
procedure
pict : pict-convertible?
procedure
w : (or/c real? #f) pict : pict-convertible?
procedure
style :
(one-of/c 'transparent 'solid 'xor 'hilite 'dot 'long-dash 'short-dash 'dot-dash 'xor-dot 'xor-long-dash 'xor-short-dash 'xor-dot-dash) pict : pict-convertible?
procedure
pict : pict-convertible?
color :
(or/c string? (is-a?/c color%) (list/c byte? byte? byte?))
procedure
(cellophane pict opacity) → pict?
pict : pict-convertible? opacity : (real-in 0 1)
procedure
(clip pict) → pict
pict : pict-convertible?
procedure
(inset/clip pict amt) → pict?
pict : pict-convertible? amt : real? (inset/clip pict h-amt v-amt) → pict? pict : pict-convertible? h-amt : real? v-amt : real? (inset/clip pict l-amt t-amt r-amt b-amt) → pict? pict : pict-convertible? l-amt : real? t-amt : real? r-amt : real? b-amt : real?
syntax
(scale/improve-new-text pict-expr scale-expr)
(scale/improve-new-text pict-expr x-scale-expr y-scale-expr)
parameter
(black-and-white on?) → void? on? : any/c
procedure
pict : pict-convertible?
This has the effect of speeding up subsequent drawing of the pict and also of cropping it to its bounding box. Any sub-picts of pict remain intact within the new pict.