Initializes a new
AlphaBlendCommand class object with explicit parameters.
Syntax
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.
- destinationRect
- Rectangle structure that contains the destination rectangle.
- opacity
- Opacity value used when combining the areas from the source and affected images. This value is between 0 and 255.
Example
Visual Basic | Copy Code |
---|
ImageProcessing.Effects.AlphaBlendCommand.AlphaBlendConstructor
Public Sub AlphaBlendConstructorExample()
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 srcImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image3.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1)
Dim Left As Integer = CType((leadImage.Width / 8), Integer)
Dim Top As Integer = CType((leadImage.Height / 8), Integer)
Dim Width As Integer = CType(leadImage.Width, Integer)
Dim Height As Integer = CType(leadImage.Height, Integer)
Dim command As AlphaBlendCommand = New AlphaBlendCommand(srcImage, New Point(0, 0), New Rectangle(Left, Top, Width, Height), 128)
command.Run(leadImage)
codecs.Save(leadImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
ImageProcessing.Effects.AlphaBlendCommand.AlphaBlendConstructor public void AlphaBlendConstructorExample() { // 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"); // Prepare the command RasterImage srcImage = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\image3.cmp", 24, CodecsLoadByteOrder.Bgr, 1, 1); AlphaBlendCommand command = new AlphaBlendCommand(srcImage, new Point(0, 0), new Rectangle(image.Width / 8, image.Height / 8, image.Width, image.Height), 128); command.Run(image); codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\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