2.2 Displaying bitmaps on the screen
bitbltallows you to copy via block transfer a block or region of bits in a bitmap; it also allows you to specify the logical boolean operation that describes how the bits in the source and destination bitmaps should be combined. For a list of the boolean operations and their logical meanings, see Common Lisp: The Language, 2nd edition, by Guy L. Steele, Jr. (hereafter referred to as CLtL2).
Create a new bitmap and window, and use
bitblt to copy the image in the first bitmap onto the new bitmap. Then copy a portion of the first bitmap onto itself:
(setq *window2* (make-window :width 100 :height 100 :x 110)) (bitblt *window* 0 0 *window2* 0 0 100 100 boole-1) (bitblt *window* 0 0 *window* 0 50 100 50 boole-1)The boolean operation
boole-1copies the source bitmap's bits and ignores any set or cleared bits in the destination bitmap.
The following example uses the function
bitblt to copy from
*window2* by using boolean operation
boole-c1, which complements the source bits in the first window's bitmap. When you copy from
*window2* to itself using
boole-c1, the original image returns:
(clear-bitmap *window2*) (bitblt *window* 0 0 *window2* 0 0 100 100 boole-c1) (bitblt *window2* 0 0 *window2* 0 0 100 100 boole-c1)Many Window Tool Kit functions require a boolean operation that describes how bits should be set or combined during that operation. For graphics output, you use the boolean operation
boole-1most often, but the other boolean operations are also useful and are supported.
Generated with Harlequin WebMaker