In addition to its color and style, a brush can have a stipple bitmap. Painting with a stipple brush is similar to calling draw-bitmap with the stipple bitmap in the filled region.
As an alternative to a color, style, and stipple, a brush can have a gradient that is a linear-gradient% or radial-gradient%. When a brush has a gradient and the target for drawing is not monochrome, then other brush settings are ignored. With a gradient, for each point in a drawing destination, the gradient associates a color to the point based on starting and ending colors and starting and ending lines (for a linear gradient) or circles (for a radial gradient); a gradient-assigned color is applied for each point that is touched when drawing with the brush.
A brush’s style is one of the following (but is ignored if the brush has a gradient and the target is not monochrome):
'transparent —
Draws with no effect (on the interior of the drawn shape). 'solid —
Draws using the brush’s color. If a monochrome stipple is installed into the brush, black pixels from the stipple are transferred to the destination using the brush’s color, and white pixels from the stipple are not transferred. 'opaque —
The same as 'solid for a color stipple. For a monochrome stipple, white pixels from the stipple are transferred to the destination using the destination’s background color. 'xor —
The same as 'solid, accepted only for partial backward compatibility. 'panel —
The same as 'solid, accepted only for partial backward compatibility. The following modes correspond to built-in stipples drawn in 'solid mode:
However, when a specific stipple is installed into the brush, the above modes are ignored and 'solid is used, instead.
To draw outline shapes (such as unfilled boxes and ellipses), use the 'transparent brush style.
To avoid creating multiple brushes with the same characteristics, use the global brush-list% object the-brush-list, or provide a color and style to set-brush in dc<%>.
| ||||||||||||||||||||||||||||
color : (or/c string? (is-a?/c color%)) = "black" | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
stipple : (or/c #f (is-a?/c bitmap%)) = #f | ||||||||||||||||||||||||||||
|
(send a-brush get-stipple) → (or/c (is-a?/c bitmap%) #f) |
|
(send a-brush get-style) | |||||||||
|
(send a-brush set-color color) → void? |
color : (is-a?/c color%) |
(send a-brush set-color color-name) → void? |
color-name : string? |
(send a-brush set-color red green blue) → void? |
red : (integer-in 0 255) |
green : (integer-in 0 255) |
blue : (integer-in 0 255) |
For the case that the color is specified using a string, see color-database<%> for information about color names.
If bitmap is modified while is associated with a brush, the effect on the brush is unspecified. A brush cannot be modified if it was obtained from a brush-list% or while it is selected into a drawing context.
(send a-brush set-style style) → void? | |||||||||||
|