3 Pict Utilities
NOTE: This library is deprecated; use pict, instead. The contents of this module, with the exceptions below, have been merged with the pict collection, or its subcollections.
(require unstable/gui/pict) | package: unstable-lib |
The functions and macros exported by this module are also exported by unstable/gui/slideshow.
3.1 Pict Colors
3.2 Pict Manipulation
procedure
pict : pict? width : real? height : real? mode : (or/c 'preserve 'inset 'distort) = 'preserve
> (frame (scale-to (circle 100) 40 20)) > (frame (scale-to (circle 100) 40 20 #:mode 'inset)) > (frame (scale-to (circle 100) 40 20 #:mode 'distort))
3.2.1 Conditional Manipulations
These pict transformers all take boolean arguments that determine whether to transform the pict or leave it unchanged. These transformations can be useful for staged slides, as the resulting pict always has the same size and shape, and its contents always appear at the same position, but changing the boolean argument between slides can control when the transformation occurs.
3.2.2 Conditional Combinations
These bindings provide additional control over the combinations in pict/conditional.
syntax
syntax
(with-pict-combine combine-id body ...)
> (let ([f (lambda (x) (with-pict-combine cc-superimpose (pict-case x [(circle) (circle 20)] [(disk) (disk 40)] [(text) (text "ok" null 20)])))]) (hc-append 10 (frame (f 'circle)) (frame (f 'disk)) (frame (f 'text))))
syntax
(pict-match test-expr maybe-combine [pattern pict-expr] ...)
maybe-combine =
| #:combine combine-expr
3.3 Shapes with Borders
The subsequent bindings were added by Vincent St-Amour.
procedure
(ellipse/border w h [ #:color color #:border-color border-color #:border-width border-width]) → pict? w : real? h : real? color : color/c = "white" border-color : color/c = "black" border-width : real? = 2
procedure
(circle/border diameter [ #:color color #:border-color border-color #:border-width border-width]) → pict? diameter : real? color : color/c = "white" border-color : color/c = "black" border-width : real? = 2
procedure
(rectangle/border w h [ #:color color #:border-color border-color #:border-width border-width]) → pict? w : real? h : real? color : color/c = "white" border-color : color/c = "black" border-width : real? = 2
procedure
(rounded-rectangle/border w h [ #:color color #:border-color border-color #:border-width border-width #:corner-radius corner-radius #:angle angle]) → pict? w : real? h : real? color : color/c = "white" border-color : color/c = "black" border-width : real? = 2 corner-radius : real? = -0.25 angle : real? = 0
> (ellipse/border 80 40 #:border-color "blue") > (rounded-rectangle/border 60 60 #:color "red" #:angle 1 #:border-width 3) > (circle/border 40 #:color "green" #:border-color "purple") > (rectangle/border 200 20 #:border-width 5)
3.4 Lines with Labels
The subsequent bindings were added by Scott Owens.
procedure
(pin-label-line label pict src-pict src-coord-fn dest-pict dest-coord-fn [ #:start-angle start-angle #:end-angle end-angle #:start-pull start-pull #:end-pull end-pull #:line-width line-width #:color color #:alpha alpha #:style style #:under? under? #:x-adjust x-adjust #:y-adjust y-adjust]) → pict? label : pict? pict : pict? src-pict : pict-path? src-coord-fn : (-> pict-path? (values real? real?)) dest-pict : pict-path? dest-coord-fn : (-> pict-path? (values real? real?)) start-angle : (or/c real? #f) = #f end-angle : (or/c real? #f) = #f start-pull : real? = 1/4 end-pull : real? = 1/4 line-width : (or/c real? #f) = #f color : (or/c #f string? (is-a?/c color%)) = #f alpha : (real-in 0 1) = 1 style : pen-style/c = 'solid under? : any/c = #f x-adjust : real? = 0 y-adjust : real? = 0
procedure
(pin-arrow-label-line label arrow-size pict src-pict src-coord-fn dest-pict dest-coord-fn [ #:start-angle start-angle #:end-angle end-angle #:start-pull start-pull #:end-pull end-pull #:line-width line-width #:color color #:alpha alpha #:style style #:solid? solid? #:under? under? #:hide-arrowhead? hide-arrowhead? #:x-adjust x-adjust #:y-adjust y-adjust]) → pict? label : pict? arrow-size : real? pict : pict? src-pict : pict-path? src-coord-fn : (-> pict-path? (values real? real?)) dest-pict : pict-path? dest-coord-fn : (-> pict-path? (values real? real?)) start-angle : (or/c real? #f) = #f end-angle : (or/c real? #f) = #f start-pull : real? = 1/4 end-pull : real? = 1/4 line-width : (or/c real? #f) = #f color : (or/c #f string? (is-a?/c color%)) = #f alpha : (real-in 0 1) = 1 style : pen-style/c = 'solid solid? : boolean? = #t under? : any/c = #f hide-arrowhead? : any/c = #f x-adjust : real? = 0 y-adjust : real? = 0
procedure
(pin-arrows-label-line label arrow-size pict src-pict src-coord-fn dest-pict dest-coord-fn [ #:start-angle start-angle #:end-angle end-angle #:start-pull start-pull #:end-pull end-pull #:line-width line-width #:color color #:alpha alpha #:style style #:solid? solid? #:under? under? #:hide-arrowhead? hide-arrowhead? #:x-adjust x-adjust #:y-adjust y-adjust]) → pict? label : pict? arrow-size : real? pict : pict? src-pict : pict-path? src-coord-fn : (-> pict-path? (values real? real?)) dest-pict : pict-path? dest-coord-fn : (-> pict-path? (values real? real?)) start-angle : (or/c real? #f) = #f end-angle : (or/c real? #f) = #f start-pull : real? = 1/4 end-pull : real? = 1/4 line-width : (or/c real? #f) = #f color : (or/c #f string? (is-a?/c color%)) = #f alpha : (real-in 0 1) = 1 style : pen-style/c = 'solid solid? : boolean? = #t under? : any/c = #f hide-arrowhead? : any/c = #f x-adjust : real? = 0 y-adjust : real? = 0
> (let* ([a (red (disk 20))] [b (blue (filled-rectangle 20 20))] [p (vl-append a (hb-append (blank 100) b))]) (pin-arrow-label-line (rotate (text "label" null 10) (/ pi -4)) 10 p a rb-find b lt-find))
3.5 Blur
The subsequent bindings were added by Ryan Culpepper.
procedure
(blur-bitmap! bitmap h-radius [v-radius]) → void?
bitmap : (is-a?/c bitmap%) h-radius : (and/c real? (not/c negative?)) v-radius : (and/c real? (not/c negative?)) = h-radius
3.6 Shadow Frames
procedure
(arch outer-width inner-width solid-height leg-height) → pict? outer-width : real? inner-width : real? solid-height : real? leg-height : real?
3.7 Drawing
The subsequent bindings were added by Jay McCarthy.
3.8 Additional combinators
The subsequent bindings were added by Asumu Takikawa.
> (backdrop (circle 20) #:color "whitesmoke") > (backdrop (text "broccoli rabé") #:color "PaleGreen")
procedure
(cross-out pict [ #:width width #:style style #:color color]) → pict? pict : pict? width : real? = 1
style :
(or/c 'transparent 'solid 'xor 'hilite 'dot 'long-dash 'short-dash 'dot-dash 'xor-dot 'xor-long-dash 'xor-short-dash 'xor-dot-dash) = 'solid color : color/c = "black"
> (cross-out (circle 20)) > (cross-out (rectangle 30 20) #:width 2 #:style 'long-dash) > (cross-out (text "rapini") #:width 3 #:color "red")
3.9 PLT Logos
(require unstable/gui/pict/plt-logo) | |
package: unstable-lib |
The subsequent bindings were added by Jay McCarthy.
procedure
(make-plt-title-background w h) → pict?
w : real? h : real?