←Select platform

FadedMaskCommand Constructor(int,int,int,int,FadedMaskCommandFlags,int,RasterColor)

Summary
Initializes a new FadedMaskCommand class object with explicit parameters.
Syntax
C#
C++/CLI
Python
public: 
FadedMaskCommand(  
   int length, 
   int fadeRate, 
   int stepSize, 
   int inflate, 
   FadedMaskCommandFlags flags, 
   int maximumGray, 
   RasterColor transparent 
) 
__init__(self,length,fadeRate,stepSize,inflate,flags,maximumGray,transparent) # Overloaded constructor 

Parameters

length
Value that represents the extent of the fade, in pixels.

fadeRate
Value that represents the rate at which the color will fade with each step. Values are between 0 and 255.

stepSize
Step size at which the color will change. This value is in pixels.

inflate
Value used to expand the resulting image. This parameter is valid only when FadedMaskCommandFlags.FadeOutsideRegion flag is set.

flags
Flags that indicate how the fade mask will be created.

maximumGray
The maximum value of the fade color. Possible values are between 0 and 255.

transparent
Contains the transparency color.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Effects; 
 
 
public void FeatherAlphaBlendCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   RasterImage backgroundImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp")); 
   RasterImage sourceImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "LittleGFlyingAlpha.png"), 32, CodecsLoadByteOrder.Bgr, 1, 1); 
   FeatherAlphaBlendCommand command = new FeatherAlphaBlendCommand(); 
   command.DestinationRectangle = new LeadRect(0, 0, sourceImage.Width, sourceImage.Height); 
   command.MaskImage = sourceImage.CreateAlphaImage(); 
   command.SourceImage = sourceImage; 
   command.SourcePoint = new LeadPoint(0, 0); 
   command.Run(backgroundImage); 
   codecs.Save(backgroundImage, 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.