ArithmeticDIBConst  Method

Description         This method makes an arithmetic operation on a device independent bitmap and a constant value. The result is put to a newly created DIB and the source DIB is 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 DIB must contain grayscale image and the palette values in the source DIB must be monotone increasing.

Syntax                 lRet = [BIFilter.]ArithmeticDIBConst Operation Dib Const iShowProgress hWnd

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

                            Operation               short                Specify the operation.

                            Dib                          LONGLONG Source DIB.

                            Const                      Long                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       +    Const

1      OPER_SUB         PixelResult = PixelSource1       -     Const

2      OPER_MUL         PixelResult = PixelSource1       *     Const

3      OPER_DIV           PixelResult = PixelSource1       /     Const

4      OPER_AND         PixelResult = PixelSource1       &    Const

5      OPER_NAND       PixelResult = ~(PixelSource1    &    Const)

6      OPER_OR           PixelResult = PixelSource1       |     Const

7      OPER_NOR         PixelResult = ~(PixelSource1    |     Const)

8      OPER_XOR         PixelResult = PixelSource1       ^     Const

9      OPER_MIN          PixelResult = MIN    (PixelSource1, Const)

10    OPER_MAX         PixelResult = MAX  (PixelSource1, Const)

11    OPER_EXP         PixelResult = EXP   (PixelSource1)

12    OPER_LOG         PixelResult = LOG   (PixelSource1)

See Also