SETBITMODE mode
Sets the current bitmap mode according to mode
.
The mode
input must be a number from 1 to 9.
The meaning of each value is given by the following table:
Mode | Meaning |
---|---|
1 | Take copy of memory then copy to screen |
2 | Take copy of memory OR with copy of screen then copy to screen |
3 | Take copy of memory AND with copy of screen then copy to screen |
4 | Take copy of memory XOR with copy of screen then copy to screen |
5 | Take copy of memory AND with invert of screen then copy to screen |
6 | Take invert of memory then copy to screen |
7 | Take copy of memory OR with copy of screen then invert to screen |
8 | Take invert of memory OR with copy of screen then copy to screen |
9 | Take invert of screen then copy to screen |
The purpose of SETBITMODE is to allow images to be pasted using different methods. Sometimes you want the background erased and sometimes not. Sometimes you wish to invert the image before pasting it and sometimes not.
Use BITMODE to obtain the current setting.
; Fill the screen with white
SETSCREENCOLOR [255 255 255]
; Draw a circle and fill it with red
PENDOWN
CIRCLE 50
SETFLOODCOLOR [255 0 0]
FILL
; Copy the red circle to the clipboard
PENUP
SETXY -50 -50
BITCOPY 101 101
; Fill the screen with yellow
SETSCREENCOLOR [255 255 0]
; Paste by simply copying the image onto the background
SETBITMODE 1
BITPASTE
; Notice how the white background still exists
; Fill the screen with yellow
SETSCREENCOLOR [255 255 0]
; Now, paste by AND-ing the image onto the background
SETBITMODE 3
BITPASTE
; Notice the white background disappeared