ArithmeticDIB  Method

Description         This method makes an arithmetic operation on two device independent bitmaps. The result is put to a newly created DIB and the source DIBs are unmodified. It works with 1, 4, 8 or 24 bits/pixel. In case of 24 bits/pixel, the arithmetic operation is made separately on the R, G, B channels. In case of 4 or 8 bits/pixel, the source DIBs must contain grayscale images and the palette values in the source DIBs must be monotone increasing. The two source DIBs must be the same size and the same bits/pixel resolution.

Syntax                 lRet = [BIFilter.]ArithmeticDIB  Operation Dib1 Dib2 iShowProgress hWnd

Remarks             lRet                         LONGLONG Handle of the newly created DIB on success or 0 on failure.

                            Operation               short                Specify the operation.

                            Dib1                        LONGLONG Source DIB.

                            Dib2                        LONGLONG Second argument of the operation.

                            iShowProgress       short                This parameter specifies the displaying of the progressbar and the preview dialog.

Available values:

DISPLAY_NONE (0) - The progressbar and the preview dialog will not display before filtering.

DISPLAY_PROGRESS (1) - The progressbar will display during filtering procedure.

DISPLAY_DIALOG (2) - The preview dialog will display before filtering. This dialog shows the part of the image before and after filtering.

DISPLAY_BOTH (3) - The progressbar and the preview dialog will display.

IMPORTANT: The preview dialog will only display, if there is BIDlgs32.dll installed.

                            hWnd                     LONGLONG Handler of the parent window.

 

Possible values of the Operation parameter:

 

0      OPER_ADD         PixelResult = PixelSource1       +    PixelSource2

1      OPER_SUB         PixelResult = PixelSource1       -     PixelSource2

2      OPER_MUL         PixelResult = PixelSource1       *     PixelSource2

3      OPER_DIV           PixelResult = PixelSource1       /     PixelSource2

4      OPER_AND         PixelResult = PixelSource1       &    PixelSource2

5      OPER_NAND       PixelResult = ~(PixelSource1    &    PixelSource2)

6      OPER_OR           PixelResult = PixelSource1       |     PixelSource2

7      OPER_NOR         PixelResult = ~(PixelSource1    |     PixelSource2)

8      OPER_XOR         PixelResult = PixelSource1       ^     PixelSource2

9      OPER_MIN          PixelResult = MIN    (PixelSource1, PixelSource2)

10    OPER_MAX         PixelResult = MAX  (PixelSource1, PixelSource2)

11    OPER_EXP         PixelResult = EXP   (PixelSource1)

12    OPER_LOG         PixelResult = LOG   (PixelSource1)

See Also