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;} |
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 Basic | Copy 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")
Dim command As AddMessageCommand = New AddMessageCommand
command.FileName = LeadtoolsExamples.Common.ImagesPath.Path + "Message.txt"
command.Message = Nothing
command.Password = "LEAD Technologies"
command.Start = New Point(0, 0)
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