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



sourceImage
RasterImage object that references the source image.
sourcePoint
Point structure that contains the origin of the source rectangle.
destinationRectangle
Rectangle structure that contains the destination rectangle.
opacity
Opacity value used when combining the areas from the result of feathering and destination images. Valid values range from 0 to 255.
maskImage
RasterImage object that references the fade mask, if you want to combine the two images just with opacity set this parameter to null.
underlayImage
RasterImage that references the image to be used as the underlying image. The command will use this image to underlay the mask image. You could ignore this parameter effect by passing null.
underlayOffset
References 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 gives the user the ability to provide the feel of continuous texture when applying this command to neighboring parts inside the destination image using the same or different mask. If underlayImage is null also set this parameter to null.
Initializes a new TextureAlphaBlendCommand 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 opacity As Integer, _
   ByVal maskImage As RasterImage, _
   ByVal underlayImage As RasterImage, _
   ByVal underlayOffset As Point _
)
Visual Basic (Usage)Copy Code
Dim sourceImage As RasterImage
Dim sourcePoint As Point
Dim destinationRectangle As Rectangle
Dim opacity As Integer
Dim maskImage As RasterImage
Dim underlayImage As RasterImage
Dim underlayOffset As Point
 
Dim instance As TextureAlphaBlendCommand(sourceImage, sourcePoint, destinationRectangle, opacity, maskImage, underlayImage, underlayOffset)
C# 
public TextureAlphaBlendCommand( 
   RasterImage sourceImage,
   Point sourcePoint,
   Rectangle destinationRectangle,
   int opacity,
   RasterImage maskImage,
   RasterImage underlayImage,
   Point underlayOffset
)
C++/CLI 
public:
TextureAlphaBlendCommand( 
   RasterImage sourceImage,
   Point sourcePoint,
   Rectangle destinationRectangle,
   int opacity,
   RasterImage maskImage,
   RasterImage underlayImage,
   Point underlayOffset
)

Parameters

sourceImage
RasterImage object that references the source image.
sourcePoint
Point structure that contains the origin of the source rectangle.
destinationRectangle
Rectangle structure that contains the destination rectangle.
opacity
Opacity value used when combining the areas from the result of feathering and destination images. Valid values range from 0 to 255.
maskImage
RasterImage object that references the fade mask, if you want to combine the two images just with opacity set this parameter to null.
underlayImage
RasterImage that references the image to be used as the underlying image. The command will use this image to underlay the mask image. You could ignore this parameter effect by passing null.
underlayOffset
References 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 gives the user the ability to provide the feel of continuous texture when applying this command to neighboring parts inside the destination image using the same or different mask. If underlayImage is null also set this parameter to null.

Example

Run the TextureAlphaBlendCommand on an image.

Visual BasicCopy Code
Public Sub TextureAlphaBlendConstructorExample()
   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
   Dim srcImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Image3.cmp", 4, CodecsLoadByteOrder.Bgr, 1, 1)
   'Load the fade mask image.
   Dim maskImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "FadeMask.bmp", 4, CodecsLoadByteOrder.Bgr, 1, 1)
   Dim underlayImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Slave.jpg", 4, CodecsLoadByteOrder.Bgr, 1, 1)

   Dim rect As Rectangle = New Rectangle(leadImage.Width \ 2 - maskImage.Width \ 2, leadImage.Height \ 2 - maskImage.Height \ 2, maskImage.Width, maskImage.Height)

   Dim command As TextureAlphaBlendCommand = New TextureAlphaBlendCommand(srcImage, New Point(0, 0), rect, 100, maskImage, underlayImage, New Point(150, 10))
   ' Combine ImageSource with the affected image, with MaskImage and a 100 opacity.
   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)

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

   // 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 
   RasterImage srcImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Image3.cmp", 4, CodecsLoadByteOrder.Bgr, 1, 1); 
 
   //Load the fade mask image. 
   RasterImage maskImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "FadeMask.bmp", 4, CodecsLoadByteOrder.Bgr, 1, 1); 
 
   RasterImage underlayImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Slave.jpg", 4, CodecsLoadByteOrder.Bgr, 1, 1); 
 
   Rectangle rect = new Rectangle(image.Width / 2 - maskImage.Width / 2, image.Height / 2  - maskImage.Height / 2, maskImage.Width, maskImage.Height); 
 
   TextureAlphaBlendCommand command = new TextureAlphaBlendCommand(srcImage, new Point(0, 0), rect, 100, maskImage, underlayImage, new Point(150, 10)); 
 
   // Combine ImageSource with the affected image, with MaskImage and a 100 opacity. 
   command.Run(image); 
   codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 
 
   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