Combines two images so that one appears to be an underlying texture for the other.
public void Underlay(RasterImage underlayImage,RasterImageUnderlayFlags flags)
Public Sub Underlay( _ByVal underlayImage As RasterImage, _ByVal flags As RasterImageUnderlayFlags _)
- (BOOL)underlay:(LTRasterImage *)underlayImageflags:(LTRasterImageUnderlayFlags)flagserror:(NSError **)error
public void underlay(RasterImage underlayImage,RasterImageUnderlayFlags flags)
public:void Underlay(RasterImage^ underlayImage,RasterImageUnderlayFlags flags)
underlayImage
The image that will be used as the underlying image. This is the image that appears to be on bottom and is grayscaled as it is combined with the target image.
flags
Indicators of how the underlying image is to be positioned.
This is most effective when the underlying image is a filtered one, such as an embossed image.
This method changes the colors of the underlay to grayscale as it combines the images. It updates this RasterImage, leaving the underlayImage unchanged. underlayImage can either be stretched or tiled to fill the image, as shown in the following illustration:

For more information, refer to Introduction to Image Processing With LEADTOOLS.
For more information, refer to Applying Artistic Effects.
This example draws an ellipse on the image.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Core;using Leadtools.ImageProcessing.Color;using Leadtools.Dicom;using Leadtools.Drawing;using Leadtools.Controls;using LeadtoolsExamples.Common;using Leadtools.Svg;public void UnderlayExample(){RasterCodecs codecs = new RasterCodecs();RasterImage image = codecs.Load(Path.Combine(ImagesPath.Path, "IMAGE1.CMP"));// Load underlay imageRasterImage underlayImage = codecs.Load(Path.Combine(ImagesPath.Path, "ULAY1.BMP"));// Use underlayImage as a tiled underlay for imageimage.Underlay(underlayImage, RasterImageUnderlayFlags.None);codecs.Save(image, Path.Combine(ImagesPath.Path, "IMAGE1_underlay.BMP"), RasterImageFormat.Bmp, 0);image.Dispose();underlayImage.Dispose();codecs.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.CoreImports Leadtools.ImageProcessing.ColorImports Leadtools.ControlsImports Leadtools.DicomImports Leadtools.DrawingImports Leadtools.SvgPublic Sub UnderlayExample()Dim codecs As RasterCodecs = New RasterCodecs()Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1.CMP"))' Load underlay imageDim underlayImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ULAY1.BMP"))' Use underlayImage as a tiled underlay for imageimage.Underlay(underlayImage, RasterImageUnderlayFlags.None)codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1_underlay.BMP"), RasterImageFormat.Bmp, 0)image.Dispose()underlayImage.Dispose()codecs.Dispose()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
c#[Silverlight C# Example]using Leadtools;using Leadtools.Codecs;using Leadtools.Dicom;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Core;using Leadtools.ImageProcessing.Color;using Leadtools.Examples;using Leadtools.Windows.Media;public void UnderlayExample(RasterImage image, RasterImage underlayImage, Stream destStream){// Use underlayImage as a tiled underlay for imageimage.Underlay(underlayImage, RasterImageUnderlayFlags.None);RasterCodecs codecs = new RasterCodecs();codecs.Save(image, destStream, RasterImageFormat.Bmp, 0);image.Dispose();underlayImage.Dispose();}vb[Silverlight VB Example]Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.DicomImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.CoreImports Leadtools.ImageProcessing.ColorImports Leadtools.Windows.MediaPublic Sub UnderlayExample(ByVal image As RasterImage, ByVal underlayImage As RasterImage, ByVal destStream As Stream)' Use underlayImage as a tiled underlay for imageimage.Underlay(underlayImage, RasterImageUnderlayFlags.None)Dim codecs As RasterCodecs = New RasterCodecs()codecs.Save(image, destStream, RasterImageFormat.Bmp, 0)image.Dispose()underlayImage.Dispose()End Sub
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
