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



Gets or sets a string that contains the name of the file that will be added to the image.

Syntax

Visual Basic (Declaration) 
Public Property FileName As String
Visual Basic (Usage)Copy Code
Dim instance As AddMessageCommand
Dim value As String
 
instance.FileName = value
 
value = instance.FileName
C# 
public string FileName {get; set;}
C++/CLI 
public:
property String^ FileName {
   String^ get();
   void set (String^ value);
}

Return Value

String that contains the name of the file that will be added to the image. When adding a message to the image this string contains the name of the file that will be added, and the message property must be set to null, otherwise this parameter has no effect.

Example

Run the AddMessageCommand on an image.

Visual BasicCopy Code
Public Sub FileNamePropertyExample()
   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 command As AddMessageCommand = New AddMessageCommand
   ' Assign the file name.
   command.FileName = LeadtoolsExamples.Common.ImagesPath.Path + "Message.txt"
   ' You must set this property to null.
   command.Message = Nothing
   ' Assign the password.
   command.Password = "LEAD Technologies"
   ' The starting point.
   command.Start = New Point(0, 0)
   ' Run the commnad.
   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)

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

   // 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 
   AddMessageCommand command = new AddMessageCommand(); 
   // Assign the file name. 
   command.FileName = LeadtoolsExamples.Common.ImagesPath.Path + "Message.txt"; 
   // You must set this property to null. 
   command.Message = null; 
   // Assign the password. 
   command.Password = "LEAD Technologies"; 
   // The starting point. 
   command.Start = new Point(0,0); 
   // Run the commnad. 
   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