2.2 Basic Pict Constructors
w : real? |
h : real? |
w : real? |
h : real? |
a : real? |
d : real? |
Creates an arbitrary self-rendering pict. The arguments to the rendering procedure will be a device context and top-left location for drawing.
When the rendering procedure is called, the current pen and brush will be solid and in the pict’s color (and linewidth), and the scale and offset of the dc will be set. The text mode will be transparent, but the font and text colors are not guaranteed to be anything in particular.
size : real? = 0 |
w : real? |
h : real? |
w : real? |
a : real? |
d : real? |
w : real? |
h : real? |
a : real? |
d : real? |
Creates a pict that draws nothing. The one-argument case supplies a value sued for both the width and height. In the one- and two-argument case, the ascent and descent are 0 for the resulting pict’s bounding box; in the three-argument case, the height is computed by adding the given ascent and descent.
content : string? |
style : text-style/c = null |
size : (integer-in 1 255) = 12 |
angle : real? = 0 |
Creates a pict that draws text. For creating text picts within a slide presentation, see t, instead. Otherwise, before calling this function, a drawing context must be installed with dc-for-text-size.
The style argument must be one of the following:
null – the default, same as 'default
a font% object
a font family symbol, such a 'roman (see font%)
a font face string, such as "Helvetica" (see font%)
(cons str sym) combining a face string and a font family (in case the face is unavailable; see font%)
(cons 'bold style) for a valid style
(cons 'italic style)
(cons 'subscript style)
(cons 'superscript style)
(cons 'caps style)
(cons 'combine style) – allows kerning and ligatures (the default, unless the 'modern family is specified)
(cons 'no-combine style) – renders characters individually
If both 'combine and 'no-combine are specified, the first one takes precedence. If caps is specified, the angle must be zero.
The given size is in pixels, but it is ignored if a font% object is provided in the text-style.
The rotation is in radians, and positive values rotate counter-clockwise. For a non-zero rotation, the resulting pict’s bounding box covers the rotated text, and the descent is zero and the ascent is the height.
w : real? |
h : real? |
w : real? |
h : real? |
Straight lines, centered within their bounding boxes.
| ||||||||||||||||||||||||||||
pict : pict? | ||||||||||||||||||||||||||||
Frames a given pict. If the color or line width are provided, the override settings supplied by the context.
w : real? |
h : real? |
diameter : real? |
(filled-ellipse w h) → pict? |
w : real? |
h : real? |
diameter : real? |
Unfilled and filled ellipses.
w : real? |
h : real? |
(filled-rectangle w h) → pict? |
w : real? |
h : real? |
Unfilled and filled rectangles.
| ||||||||||||||||||||||||||||
w : real? | ||||||||||||||||||||||||||||
h : real? | ||||||||||||||||||||||||||||
corner-radius : real? = -0.25 | ||||||||||||||||||||||||||||
angle : real? = 0 | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
w : real? | ||||||||||||||||||||||||||||
h : real? | ||||||||||||||||||||||||||||
corner-radius : real? = -0.25 | ||||||||||||||||||||||||||||
angle : real? = 0 |
Unfilled and filled rectangles with rounded corners. The corner-radius is used to determine how much rounding occurs in the corners. If it is a positive number, then it determines the radius of a circle touching the edges in each corner, and the rounding of the rectangle follow the edge of those circles. If it is a negative number, then the radius of the circles in the corners is the absolute value of the corner-radius times the smaller of width and height.
The angle determines how much the rectangle is rotated, in radians.
img : (or/c path-string? (is-a?/c bitmap%)) |
A pict that display a bitmap. When a path is provided, the image is loaded with the 'unknown/mask flag, which means that a mask bitmap is generated if the file contains a mask.
If the bitmap cannot be loaded, if the given bitmap% object is not valid, or if the bitmap-draft-mode parameter is set to #t, the result pict draws the word “bitmap failed”.
size : real? |
radians : real? |
size : real? |
radians : real? |
Creates an arrow or arrowhead in the specific direction within a size by size pict. Points on the arrow may extend slightly beyond the bounding box.
dx : real? |
dy : real? |
size : real? |
(pip-arrow-line dx dy size) → pict? |
dx : real? |
dy : real? |
size : real? |
(pip-arrows-line dx dy size) → pict? |
dx : real? |
dy : real? |
size : real? |
Creates a line (with some number of arrowheads) as a zero-sized pict suitable for use with pin-over. The 0-sized picture contains the starting point.
The size is used for the arrowhead size. Even though pip-line creates no arrowheads, it accepts the size argument for consistency with the other functions.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pict : pict? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
src : pict-path? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dest : pict-path? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
under? : any/c = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
arrow-size : real? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pict : pict? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
src : pict-path? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dest : pict-path? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
under? : any/c = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
solid? : any/c = #t | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
arrow-size : real? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pict : pict? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
src : pict-path? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dest : pict-path? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
under? : any/c = #f | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
solid? : any/c = #t |
Adds a line or line-with-arrows onto pict, using one of the pict-finding functions (e.g., lt-find) to extract the source and destination of the line.
If under? is true, then the line and arrows are added under the existing pict drawing, instead of on top. If solid? is false, then the arrowheads are hollow instead of filled.
A contract that matches the second argument of text.
(bitmap-draft-mode on?) → void? |
on? : any/c |
A parameter that determines whether bitmap loads/uses a bitmap.