29 Unsafe Libraries
The racket/draw library is currently implemented using Cairo and Pango. The get-handle in bitmap% method exposes the underlying Cairo surface for a bitmap% object, while make-handle-brush supports the creation of a brush from an existing Cairo surface. The representation of handles for these methods, however, is subject to change if the racket/draw library is implemented differently in the future.
29.1 Handle Brushes
| (require racket/draw/unsafe/brush) | package: draw-lib |
procedure
(make-handle-brush handle width height transformation [ #:copy? copy?]) → (is-a?/c brush%) handle : cpointer? width : exact-nonnegative-integer? height : exact-nonnegative-integer?
transformation :
(or/c #f (vector/c (vector/c real? real? real? real? real? real?) real? real? real? real? real?)) copy? : any/c = #t
The width and height arguments specify the surface
bounds for use when the surface must be copied—
The given surface is treated much like a stipple bitmap: it is implicitly repeated, and the given transformation (if any) determines the surface’s alignment relative to the target drawing context.
When the brush is used with a record-dc% object, and if that object’s get-recorded-datum method is called, then the surface is effectively converted to a stipple bitmap for the result datum.
29.2 Cairo Library
| (require racket/draw/unsafe/cairo-lib) | package: draw-lib |
29.3 Pango Library
| (require racket/draw/unsafe/pango-lib) | package: draw-lib |
Added in version 1.25 of package draw-lib.
Added in version 1.25 of package draw-lib.