Leadtools.ImageProcessing.Effects Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
FeatherAlphaBlendCommand Constructor(RasterImage,Point,Rectangle,RasterImage,Point)
See Also  Example
Leadtools.ImageProcessing.Effects Namespace > FeatherAlphaBlendCommand Class > FeatherAlphaBlendCommand Constructor : FeatherAlphaBlendCommand Constructor(RasterImage,Point,Rectangle,RasterImage,Point)



sourceImage
RasterImage object that references the source image.
sourcePoint
Point structure that contains the origin of the source rectangle. The width and height are the same width and height for the destination rectangle.
destinationRectangle
Rectangle structure that contains the destination rectangle.
maskImage
RasterImage object that references the fade mask. If you want to combine the two images just with opacity set this property to null.
maskSourcePoint
Point structure that contains the origin of the mask rectangle. The width and height for the mask rectangle are the same width and height for the destination rectangle.
Initializes a new FeatherAlphaBlendCommand class object with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal sourceImage As RasterImage, _
   ByVal sourcePoint As Point, _
   ByVal destinationRectangle As Rectangle, _
   ByVal maskImage As RasterImage, _
   ByVal maskSourcePoint As Point _
)
Visual Basic (Usage)Copy Code
Dim sourceImage As RasterImage
Dim sourcePoint As Point
Dim destinationRectangle As Rectangle
Dim maskImage As RasterImage
Dim maskSourcePoint As Point
 
Dim instance As FeatherAlphaBlendCommand(sourceImage, sourcePoint, destinationRectangle, maskImage, maskSourcePoint)
C# 
public FeatherAlphaBlendCommand( 
   RasterImage sourceImage,
   Point sourcePoint,
   Rectangle destinationRectangle,
   RasterImage maskImage,
   Point maskSourcePoint
)
C++/CLI 
public:
FeatherAlphaBlendCommand( 
   RasterImage sourceImage,
   Point sourcePoint,
   Rectangle destinationRectangle,
   RasterImage maskImage,
   Point maskSourcePoint
)

Parameters

sourceImage
RasterImage object that references the source image.
sourcePoint
Point structure that contains the origin of the source rectangle. The width and height are the same width and height for the destination rectangle.
destinationRectangle
Rectangle structure that contains the destination rectangle.
maskImage
RasterImage object that references the fade mask. If you want to combine the two images just with opacity set this property to null.
maskSourcePoint
Point structure that contains the origin of the mask rectangle. The width and height for the mask rectangle are the same width and height for the destination rectangle.

Example

Run the FeatherAlphaBlendCommand on an image.

Visual BasicCopy Code
Public Sub FeatherAlphaBlendConstructorExample_S2()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

   ' Prepare the command
   Try
      Dim maskImage As RasterImage
      ' Loading the maskimage.
      maskImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Image3.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1)
      Dim command As FeatherAlphaBlendCommand = New FeatherAlphaBlendCommand(leadImage, New Point(leadImage.Width \ 2, leadImage.Height \ 2), New Rectangle(0, 0, leadImage.Width \ 2, leadImage.Height \ 2), maskImage, New Point(leadImage.Width \ 2, leadImage.Height \ 2))
      command.Run(leadImage)
      codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void FeatherAlphaBlendConstructorExample_S2() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); 
 
   // Prepare the command 
   try 
   { 
      RasterImage maskImage; 
      // Loading the maskimage. 
      maskImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Image3.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1); 
      FeatherAlphaBlendCommand command = new FeatherAlphaBlendCommand(image, new Point(image.Width / 2, image.Height / 2), new Rectangle(0, 0, image.Width / 2, image.Height / 2), maskImage, new Point(image.Width / 2, image.Height / 2)); 
      command.Run(image); 
      codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 
   } 
   catch (Exception exception) 
   { 
      MessageBox.Show(exception.Message); 
   } 
 
   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