public RasterImage UnderlayImage { get; set; }
public:
property RasterImage^ UnderlayImage {
RasterImage^ get();
void set ( RasterImage^ );
}
UnderlayImage # get and set (TextureAlphaBlendCommand)
RasterImage object that references the image to be used as the underlying image. The command will use this image to underlay the mask image. You could ignore this property effect by passing null.
Run the TextureAlphaBlendCommand on an image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Effects;
public void UnderlayImagePropertyExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"));
// Prepare the command
RasterImage srcImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\Image3.cmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1);
//Load the fade mask image.
RasterImage maskImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\FadeMask.bmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1);
TextureAlphaBlendCommand command = new TextureAlphaBlendCommand();
command.DestinationRectangle = new LeadRect(image.Width / 2 - maskImage.Width / 2, image.Height / 2 - maskImage.Height / 2, maskImage.Width, maskImage.Height);
command.MaskImage = maskImage;
command.Opacity = 100;
command.SourceImage = srcImage;
command.SourcePoint = new LeadPoint(0, 0);
command.UnderlayImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"), 4, CodecsLoadByteOrder.Bgr, 1, 1);
command.UnderlayOffset = new LeadPoint(150, 10);
// Combine ImageSource with the affected image, with MaskImage and a 100 opacity.
command.Run(image);
codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document