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.
Example
Run the FeatherAlphaBlendCommand on an image.
Visual Basic | Copy Code |
---|
Public Sub FeatherAlphaBlendConstructorExample_S1()
RasterCodecs.Startup()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")
Try
Dim maskImage As RasterImage
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)
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_S1() { // 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); 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