Leadtools.ImageProcessing.Effects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
SourcePoint Property
See Also  Example
Leadtools.ImageProcessing.Effects Namespace > AlphaBlendCommand Class : SourcePoint Property




Gets or sets the point structure that contains the origin of the source rectangle.

Syntax

Visual Basic (Declaration) 
Public Property SourcePoint As Point
Visual Basic (Usage)Copy Code
Dim instance As AlphaBlendCommand
Dim value As Point
 
instance.SourcePoint = value
 
value = instance.SourcePoint
C# 
public Point SourcePoint {get; set;}
Managed Extensions for C++ 
public: __property Point get_SourcePoint();
public: __property void set_SourcePoint( 
   Point value
);
C++/CLI 
public:
property Point SourcePoint {
   Point get();
   void set (Point value);
}

Return Value

Point structure that contain the origin of the source rectangle. the Width and Height are the same Width and Height for the destination rectangle.

Example

Visual BasicCopy Code
ImageProcessing.Effects.AlphaBlendCommand.SourcePoint
   Public Sub SourcePointPropertyExample()
      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")

      ' Prepare the command
      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)

      ' Combine srcImage with image, with half opacity.
      Dim command As AlphaBlendCommand = New AlphaBlendCommand
      command.DestinationRectangle = New Rectangle(Left, Top, Width, Height)
      command.SourceImage = srcImage
      command.SourcePoint = New Point(0, 0)
      command.Opacity = 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.SourcePoint 
      public void SourcePointPropertyExample() 
      { 
         // 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(); 
         // Combine srcImage with image, with half opacity. 
         //command.DestinationRectangle = new Rectangle(image.Width / 2 - srcImage.Width / 2, image.Height / 2 - srcImage.Height / 2, image.Width / 2 + srcImage.Width / 8, image.Height / 2 + srcImage.Height / 8); 
         command.DestinationRectangle = new Rectangle(image.Width / 8, image.Height / 8, image.Width, image.Height); 
         command.SourceImage = srcImage; 
         command.SourcePoint = new Point(0,0); 
         command.Opacity = 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