CropDIB  Method

Description         The CropDIB method crops a part of the image specified by the hDib parameter. The size of new (cropped) image is set by the 4 parameters. The values of the position parameters can be from 0 to the size of the original image - 1. LeftPosition must not be higher than RightPosition and TopPosition must not be higher than BottomPosition. (The smallest image that you can crop from an original image is 1 pixel x 1 pixel) The (0;0) point of the image is located at the upper left corner of the image. This function works for bitmaps with 1, 2, 4 , 8, 16, 24, 32 bits per pixel.

Syntax                 RetVal = [BiDib.]CropDIB hDib LeftPosition TopPosition RightPosition BottomPosition

Returns               RetVal                    LONGLONG The cropped image. 0 if an error occurred.

Remarks             hDib                       LONGLONG Device indipendent bitmap to crop.

                            LeftPosition           Long                Left position of the rectangle of cropping.
Value: from 0 to the width of original image -1

                            TopPosition           Long                Top position of the rectangle of cropping.
Value: from 0 to the height
of original image -1

                            RightPosition         Long                Right position of the rectangle of cropping.
Value: from 0 to the width of original image -1

                            BottomPosition      Long                Bottom position of the rectangle of cropping.
Value: from 0 to the height
of original image -1

See Also