Flags for the LBitmapBase::Combine Function

Note: Arithmetic calculations in this table assume 24-bit image data.

The following are the flags that define treatment of the source rectangle:

Value

Meaning

CB_SRC_NOP

[0x00000000] No change.

CB_SRC_NOT

[0x00000001] Invert the color, resulting in its complement.

CB_SRC_0

[0x00000002] Change all bits to 0.

CB_SRC_1

[0x00000003] Change all bits to 1.

The following are the flags that define treatment of the destination rectangle:

Value

Meaning

CB_DST_NOP

[0x00000000] No change.

CB_DST_NOT

[0x00000010] Invert the color, resulting in its complement.

CB_DST_0

[0x00000020] Change all bits to 0.

CB_DST_1

[0x00000030] Change all bits to 1.

The following are the flags that define the operation to use when combining the data:

Value

Meaning

CB_OP_AND

[0x00000000] Combine each set of bytes using a bitwise AND (&).

CB_OP_OR

[0x00000100] Combine each set of bytes using a bitwise OR ( | ).

CB_OP_XOR

[0x00000200] Combine each set of bytes using a bitwise exclusive OR (^).

CB_OP_ADD

[0x00000300] Add the byte values, allowing a maximum of 255.

CB_OP_SUBSRC

[0x00000400] Subtract the source from the destination, allowing a minimum of 0.

CB_OP_SUBDST

[0x00000500] Subtract the destination from the source, allowing a minimum of 0.

CB_OP_MUL

[0x00000600] Multiply the byte values, allowing a maximum of 255. The result is calculated as follows: result = (source * dest) / 255.

CB_OP_DIVSRC

[0x00000700] Divide the destination by the source. If source > 0, then the result is calculated as follows: result = min( (dest / source) * 255, 255 ). Otherwise, if source = 0, then result = 255.

CB_OP_DIVDST

[0x00000800] Divide the source by the destination. If dest > 0, then the result is calculated as follows: result = min( (source / dest) * 255, 255 ). Otherwise, if dest = 0, then result = 255.

CB_OP_AVG

[0x00000900] Use the average of the two values.

CB_OP_MIN

[0x00000A00] Use the lesser of the two values.

CB_OP_MAX

[0x00000B00] Use the greater of the two values.

The following are the flags that define treatment of the resulting image rectangle:

Value

Meaning

CB_RES_NOP

[0x00000000] No change.

CB_RES_NOT

[0x00001000] Invert the color, resulting in its complement.

CB_RES_0

[0x00002000] Change all bits to 0.

CB_RES_1

[0x00003000] Change all bits to 1.