Gets or sets an RasterImage object that references the image to be used as the underlying image.
public RasterImage UnderlayImage { get; set; } Public Property UnderlayImage As Leadtools.RasterImage public Leadtools.RasterImage UnderlayImage {get; set;} <br/>get_UnderlayImage();<br/>set_UnderlayImage(value);<br/>Object.defineProperty('UnderlayImage'); public:property Leadtools.RasterImage^ UnderlayImage {Leadtools.RasterImage^ get();void set ( Leadtools.RasterImage^ );}
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 imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"));// Prepare the commandRasterImage 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:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessing.EffectsLeadtools.Examples.Support.SetLicense()Public Sub UnderlayImagePropertyExample()Dim codecs As New RasterCodecs()codecs.ThrowExceptionsOnInvalidImages = TrueDim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"))' Prepare the commandTryDim srcImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ImageProcessingDemo\image3.cmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1)'Load the fade mask image.Dim maskImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ImageProcessingDemo\FadeMask.bmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1)Dim command As TextureAlphaBlendCommand = New TextureAlphaBlendCommandcommand.DestinationRectangle = New LeadRect(leadImage.Width \ 2 - maskImage.Width \ 2, leadImage.Height \ 2 - maskImage.Height \ 2, maskImage.Width, maskImage.Height)command.MaskImage = maskImagecommand.Opacity = 100command.SourceImage = srcImagecommand.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(leadImage)codecs.Save(leadImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24)Catch ex As ExceptionMessageBox.Show(ex.Message, "TextureAlphaBlendTest", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)End TryEnd SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
