←Select platform

DestinationRectangle Property

Summary
Gets or sets a LeadRect structure that contains the destination rectangle.
Syntax
C#
C++/CLI
Python
public LeadRect DestinationRectangle { get; set; } 
public: 
property LeadRect DestinationRectangle { 
   LeadRect get(); 
   void set (    LeadRect ); 
} 
DestinationRectangle # get and set (TextureAlphaBlendCommand) 

Property Value

LeadRect structure that contains the destination rectangle.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Effects; 
 
 
public void TextureAlphaBlendCommandExample() 
{ 
   // 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; 
   RasterImage MaskImage; 
   RasterImage underlayImage; 
 
   SrcImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\Image3.cmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1); 
   //Load the fade mask image. 
   MaskImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\FadeMask.bmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1); 
 
   underlayImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"), 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 = underlayImage; 
   // 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"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 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.