Initializes a new
FeatherAlphaBlendCommand 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.
- 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
Visual Basic | Copy Code |
---|
ImageProcessing.Effects.FeatherAlphaBlendCommand.FeatherAlphaBlendConstructor_S2
Public Sub FeatherAlphaBlendConstructorExample_S2()
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")
Try
Dim maskImage As RasterImage
maskImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\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, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
ImageProcessing.Effects.FeatherAlphaBlendCommand.FeatherAlphaBlendConstructor_S2 public void FeatherAlphaBlendConstructorExample_S2() { // 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 try { RasterImage maskImage; // Loading the maskimage. maskImage = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\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, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\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