Control of graphic output on bit level
GraphMode n [,m]
GraphMode n defines the relationship between the graphic output and the screen. This relationship involves the bit-wise combination of the current screen contents and the new graphic which is to be drawn. The parameter n specifies how this combination is to be performed. Following modes are possible:
R2_BLACK | points are always black. |
R2_WHITE | sets white points. |
R2_NOP | points are not changed. |
R2_NOT | point corresponds to the inverse of the screen color. |
R2_COPYPEN | color set with Color. |
R2_NOTCOPYPEN | inverse of color in Color |
R2_MERGEPENNOT | set point corresponds to the pen color "or-ed" with the inverse screen color. |
R2_MASKPENNOT | set points corresponds to pen color "and-ed" with inverse pen color. |
R2_MERGENOTPEN | set point corresponds to screen color "and-ed" with the inverse pen color. |
R2_MERGEPEN | point color corresponds to the pen color "or-ed" with the screen color. |
R2_NOTMERGEPEN | inverse R2-MERGEPEN color |
R2_MASKPEN | point corresponds to colors in screen and pen (logical And). |
R2_NOTMASKPEN | point corresponds to inverse R2-MASKPEN color. |
R2_XORPEN | set point is either in screen color or pen color but not in both (logical Xor). |
R2_NOTXORPEN | point color corresponds to the inverse R2_XORPEN color. |
GraphMode 1 (R2_BLACK) is default.
The second optional parameter GraphMode ,m can take on the values OPAQUE and TRANSPARENT. OPAQUE overwrites the background and is the default.
Dim a%
OpenW # 1
DefFill 4
PBox 10, 10, 100, 200 //Graphmode 1 default
PBox 15, 15, 105, 205
Delay 1
Cls
GraphMode R2_MERGEPEN //logical Or
PBox 10, 10, 100, 200
PBox 15, 15, 105, 205
Delay 1
PBox 10, 10, 100, 200
PBox 15, 15, 105, 205
Delay 1
Cls
GraphMode R2_MASKPEN //logical And
PBox 10, 10, 100, 200
PBox 15, 15, 105, 205
Delay 1
CloseW # 1
draws two overlapping rectangles.
GraphMode n conforms to the DrawMode property of the window/form.
GraphMode ,m conforms to the FontTransparent property of the window/form.
{Created by Sjouke Hamstra; Last updated: 08/10/2014 by James Gaite}