ImageGear for C and C++ on Windows v20.5 - Updated
IG_image_channel_remove
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Channel Functions > IG_image_channel_remove

This function removes the specified channel from the source image and shifts the remaining channels without transforming pixel data.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_image_channel_remove(
        HIGEAR hIGear,
        AT_UINT position
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
position AT_UINT Index of channel to remove.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++, except:

Sample:

None

Example:

 
Copy Code
/* Alter a 24-bit RGB image to use the red channel data 
   for both red and blue channels */
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGEAR hImage;          /* Handle of source image */
AT_CHANNEL_REF channel; /* Channel to add */
nErrcount = IG_load_file("test.jpg", &hImage);
channel.hImage = hImage;
channel.uNumber = 0;
nErrcount = IG_image_channel_add(hImage, 3, &channel);
nErrcount = IG_image_channel_remove(hImage, 2);
nErrcount = IG_save_file(hImage, "test.bmp", 
    IG_SAVE_BMP_UNCOMP);
IG_image_delete(hImage);
Is this page helpful?
Yes No
Thanks for your feedback.