Manju,
You can do this as follows:
Leadtools.Codecs.RasterCodecs.Startup();
Leadtools.Codecs.RasterCodecs rasterCodecs = new Leadtools.Codecs.RasterCodecs();
rasterImageViewer1.Image = rasterCodecs.Load("mask.gif", 24, Leadtools.Codecs.CodecsLoadByteOrder.Bgr, 1, 1);
MessageBox.Show("this is the mask image");
Leadtools.ImageProcessing.Color.IntensityDetectCommand intDtct = new Leadtools.ImageProcessing.Color.IntensityDetectCommand(128, 255, new Leadtools.RasterColor(Color.White), new Leadtools.RasterColor(Color.Black), Leadtools.ImageProcessing.Color.IntensityDetectCommandFlags.Master);
intDtct.Run(rasterImageViewer1.Image);
MessageBox.Show("The mask image converted to black and white, but kept 24-bit");
Leadtools.RasterImage imgMask = rasterImageViewer1.Image.Clone();
rasterImageViewer1.Image = rasterCodecs.Load("slave.jpg", imgMask.Width, imgMask.Height, 24, Leadtools.RasterSizeFlags.Resample, Leadtools.Codecs.CodecsLoadByteOrder.Bgr);
MessageBox.Show("The slave image resized");
Leadtools.Codecs.RasterCodecs.Shutdown();
Leadtools.ImageProcessing.CombineFastCommand combineFast = new Leadtools.ImageProcessing.CombineFastCommand(rasterImageViewer1.Image, new Rectangle(0, 0, rasterImageViewer1.Image.Width, rasterImageViewer1.Image.Height), new Point(0, 0), Leadtools.ImageProcessing.CombineFastCommandFlags.OperationAdd);
combineFast.Run(imgMask);
MessageBox.Show("The slave image after combine");
Amin Dodin
Senior Support Engineer
LEAD Technologies, Inc.