Gets or sets an RasterImage object that references the image to be used as the underlying image.
Syntax
Visual Basic (Declaration) | |
---|
Public Property UnderlayImage As RasterImage |
Managed Extensions for C++ | |
---|
public: __property RasterImage get_UnderlayImage();
public: __property void set_UnderlayImage(
RasterImage value
); |
Return Value
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.
Example
Visual Basic | Copy Code |
---|
ImageProcessing.Effects.TextureAlphaBlendCommand.UnderlayImage
Public Sub UnderlayImagePropertyExample()
RasterCodecs.Startup()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg")
Try
Dim srcImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image3.cmp", 4, CodecsLoadByteOrder.Bgr, 1, 1)
Dim maskImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\FadeMask.bmp", 4, CodecsLoadByteOrder.Bgr, 1, 1)
Dim command As TextureAlphaBlendCommand = New TextureAlphaBlendCommand
command.DestinationRectangle = New Rectangle(leadImage.Width \ 2 - maskImage.Width \ 2, leadImage.Height \ 2 - maskImage.Height \ 2, maskImage.Width, maskImage.Height)
command.MaskImage = maskImage
command.Opacity = 100
command.SourceImage = srcImage
command.SourcePoint = New Point(0, 0)
command.UnderlayImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Slave.jpg", 4, CodecsLoadByteOrder.Bgr, 1, 1)
command.UnderlayOffset = New Point(150, 10)
command.Run(leadImage)
codecs.Save(leadImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)
Catch ex As Exception
MessageBox.Show(ex.Message, "TextureAlphaBlendTest", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
ImageProcessing.Effects.TextureAlphaBlendCommand.UnderlayImage public void UnderlayImagePropertyExample() { // Load an image RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg"); // Prepare the command RasterImage srcImage = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image3.cmp", 4, CodecsLoadByteOrder.Bgr, 1, 1); //Load the fade mask image. RasterImage maskImage = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\FadeMask.bmp", 4, CodecsLoadByteOrder.Bgr, 1, 1); TextureAlphaBlendCommand command = new TextureAlphaBlendCommand(); command.DestinationRectangle = new Rectangle(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 Point(0, 0); command.UnderlayImage = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Slave.jpg", 4, CodecsLoadByteOrder.Bgr, 1, 1); command.UnderlayOffset = new Point(150, 10); // Combine ImageSource with the affected image, with MaskImage and a 100 opacity. command.Run(image); codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24); RasterCodecs.Shutdown(); } |
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also