←Select platform

UnderlayOffset Property

Summary
LeadPoint structure that contains the underlay image offset with respect to the destination image.
Syntax
C#
C++/CLI
Python
public LeadPoint UnderlayOffset { get; set; } 
public: 
property LeadPoint UnderlayOffset { 
   LeadPoint get(); 
   void set (    LeadPoint ); 
} 
UnderlayOffset # get and set (TextureAlphaBlendCommand) 

Property Value

LeadPoint structure that contains the underlay image offset with respect to the destination image. The command will use this point to calculate the parts of the underlay image that will be applied to the mask image. Using this point will give the user the ability to give the feel of continuous texture when applying this method to neighboring parts inside the destination image using the same or different mask. If the UnderlayImage property is set to null also set this property to null.

Example
C#
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:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Effects Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.