Leadtools.ImageProcessing.Effects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
FeatherAlphaBlendCommand Class
See Also  Members   Example 
Leadtools.ImageProcessing.Effects Namespace : FeatherAlphaBlendCommand Class




Combines image data from two images with feathering. The two images can be combined with variable opacity applied by specifying the region of a fade mask image. This command is available in the Raster Pro and above toolkits.

Syntax

Visual Basic (Declaration) 
Public Class FeatherAlphaBlendCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As FeatherAlphaBlendCommand
C# 
public class FeatherAlphaBlendCommand : RasterCommand, IRasterCommand  
Managed Extensions for C++ 
public __gc class FeatherAlphaBlendCommand : public RasterCommand, IRasterCommand  
C++/CLI 
public ref class FeatherAlphaBlendCommand : public RasterCommand, IRasterCommand  

Example

Visual BasicCopy Code
ImageProcessing.Effects.FeatherAlphaBlendCommand
   Public Sub FeatherAlphaBlendCommandExample()
      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")

      Dim command As FeatherAlphaBlendCommand = New FeatherAlphaBlendCommand
      command.DestinationRectangle = New Rectangle(0, 0, leadImage.Width \ 2, leadImage.Height \ 2)
      command.MaskImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image3.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1)
      command.SourceImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image2.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1)
      command.SourcePoint = New Point(0, 0)
      command.Run(leadImage)
      codecs.Save(leadImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)

      command.SourceImage.Dispose()

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.Effects.FeatherAlphaBlendCommand 
      public void FeatherAlphaBlendCommandExample() 
      { 
         // 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"); 
 
         FeatherAlphaBlendCommand command = new FeatherAlphaBlendCommand(); 
         command.DestinationRectangle = new Rectangle(0, 0, image.Width / 2, image.Height / 2); 
         command.MaskImage = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image3.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1); 
         command.SourcePoint = new Point(image.Width / 2, image.Height / 2); 
         command.SourceImage = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image2.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1); 
         command.Run(image); 
         codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24); 
 
         //FadeRegionImage.Dispose(); 
         command.SourceImage.Dispose(); 
 
         RasterCodecs.Shutdown(); 
      }

Remarks

  • To combine two images with a fixed opacity, use the AlphaBlendCommand.
  • The FeatherAlphaBlendCommand achieves feathering between two images by using variable opacity values, obtained from the fade mask referenced by MaskImage. Use the MaskSourcePoint to specify a region of the mask image, these values are the coordinates of the origin of the mask rectangle.
  • To create an image that contains a fade mask, use FadedMaskCommand command.
  • This command supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
  • This command does not support signed data images.
  • This command does not support 32-bit grayscale images.
For more information, refer to Processing an Image.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.Effects.FeatherAlphaBlendCommand

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