SplitColorChannels  Method

Description         This function will split the image to its color components. The function works for only 24 bit per pixel or 32 bit per pixel images. The image must be in RGB colr space. Spliting a 24 bit per pixel image will produce 3 result images, and spliting a 32 bit per pixel image will produce 4 result images. This function needs a lot of memory so be sure there is enough memory available before using this function. The method will return with the number of splited color channels, and hDibChannels pointer will contain the result image pointers as a pointer array. If the input image is 32 bit per pixel, the iFormat parameter must be FORMAT_RGB. If the third parameter is not CFRGB, the method will convert the image into the specified color space, and then split the image.  It’s important, that the hDibChannels pointer array must be already allocated by the user when this function is called. The outgoing images will be allocated by the function. Spliting of a channel generates an image where only the splited color channel remains, and all other channels are all-zero matrices.

Syntax                 lRet = [BIImage.]SplitColorChannels  Dib DibRed DibGreen DibBlue DibBlack iFormat

Remarks             lRet                         Long                Number of splited color channels on success or 0 on failure.

                            Dib                          LONGLONG Source DIB (24 or 32 bit per pixel).

                            DibRed                   LONGLONG*           This parameter will contain the result image of red component. See the description for further information.

                            DibGreen               LONGLONG*           This parameter will contain the result image of green component. See the description for further information.

                            DibBlue                  LONGLONG*           This parameter will contain the result image of blue component. See the description for further information.

                            DibBlack                LONGLONG*           This parameter will contain the result image of black component if available. See the description for further information.

                            iFormat                  short                Color space format code. E.g.: CFRGB, CFHSI, etc.

See Also