Statement macro
Runs a body of code in the context of a set of drawing options.
with-drawing-options ({medium} #rest {options}*) {body} end
duim-sheets
duim-sheets
Runs a body of code in the context of a set of drawing options. The options specified are passed to the function do-with-drawing-options for execution.
The medium expression should evaluate to an instance of <medium>.
Note that when using with-drawing-options in conjunction with a loop. it is computationally much quicker to use a medium (as shown here) rather than a sheet, and to place the call to with-drawing-options outside the loop. If necessary, use with-sheet-medium to associate the sheet with the medium, thus:
with-sheet-medium (medium = sheet)
with-drawing-options (medium, brush: color)
for (x :: <integer> from 0 to 199)
for (y :: <integer> from 0 to 199)
draw-point(medium, x, y)
end
end
end
endwith-drawing-options (medium, brush: $red) draw-rectangle (medium, 0, 0, 100, 200, filled?: #t) end;