Description

Replaces a Channel in an existing color image from a monochrome image.

Return Type

A McImage object.  

The modified color IMcImage.

Syntax

object.MergeChannel (vChannelImg, Channel, [Interpretation], [vSourceImg])

The MergeChannel Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McColorModel.
vChannelImgRequired. A Variant value.

Required monochrome channel source image or IMcRegionAccess instance. For an image the VARIANT may hold the IMcImage instance, a string image name or numeric index for an Item in the Images collection. If given as an IMcRegionAccess instance, the image type may be a multiband image if the ChannelToProcess property is set to some channel.

ChannelRequired. A Long value.

The Channel to modify.

InterpretationOptional. A mcInterpretation enumeration, as described in settings.

mcInterpretation : Optional interpretation for Channel number.

vSourceImgOptional. A Variant value.

Optional source image, operator applies to parent image when parameter is omitted. Either the parent of vSourceImg must be given.

Settings

The settings for Interpretation are:

ConstantValueDescription
 mciAnyInterp0

current interpretation

 mciMonochrome1

only one channel

 mciIndexedColor2

8 bits per pixel, pseudo-colored

 mciGenericMultiBand3

multichannel, when needed, pixel luminance is averaged across the channels

 mciRGB4

normal color model, 3 channels arranged as “RGBRGBRGB...”

 mciBGR5

Similar to RGB, except the channels are reversed for DIBs as “BGRBGRBGR...”

 mciHSL6

Three channels, Hue, Saturation, and Luminance

 mciHSI7

Three channels, Hue, Saturation, and Intensity

 mciComplex8

Two channels, real and imaginary arranged as “RIRIRI...”, only supported with McFloat

 mciPolar9

Two channels, magnitude and phase arranged as “MPMPMP...”, only supported with McFloat

Remarks

This operation is restricted to and masked by the destiation image's Aoi.

The MergeMultipleChannels method is a more general version of this method. It allows you to merge multiple channels in one operation, and it allows you to create the merged image as part of the operation.