Next Prev Up Top Contents Index

10.3.1 Setting the graphics state

The graphics state values associated with a drawing function call to a graphics port are set by one of three mechanisms.

  1. Enumeration in the drawing function call. For example:
  2.  (draw-line port 1 1 100 100 
                :thickness 10             
                :scale-thickness nil         
                :foreground :red)
  3. Bound using the with-graphics-state macro. For example:
  4. (with-graphics-state (port :thickness 10
                                 :scale-thickness nil    
                                 :foreground :red)     
        (draw-line port 1 1 100 100)  
        (draw-rectangle port 2 2 40 50 :filled t))
  5. Set by the set-graphics-state function. For example:
(set-graphics-state port :thickness 10                                
                        :scale-thickness nil  
                        :foreground :red)

The first two mechanisms change the graphics state temporarily. The last one changes it permanently, effectively altering the "default" state.


LispWorks CAPI User Guide - 14 Dec 2001

Next Prev Up Top Contents Index