SETBITMODE

Synopsis
SETBITMODE mode
Description

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:

ModeMeaning
1Take copy of memory then copy to screen
2Take copy of memory OR with copy of screen then copy to screen
3Take copy of memory AND with copy of screen then copy to screen
4Take copy of memory XOR with copy of screen then copy to screen
5Take copy of memory AND with invert of screen then copy to screen
6Take invert of memory then copy to screen
7Take copy of memory OR with copy of screen then invert to screen
8Take invert of memory OR with copy of screen then copy to screen
9Take 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.

Example
; 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

SourceForge.net Logo