Leadtools.Services.DataContracts Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
FileBinaryData Class
See Also  Members   Example 
Leadtools.Services.DataContracts Namespace : FileBinaryData Class



Loads a file from or saves a file to a disk.

Syntax

Visual Basic (Declaration) 
<DataContractAttribute(Namespace="http://Leadtools.Services.DataContracts/2009/01", Name="FileBinaryData")>
Public Class FileBinaryData 
   Inherits BinaryData
Visual Basic (Usage)Copy Code
Dim instance As FileBinaryData
C# 
[DataContractAttribute(Namespace="http://Leadtools.Services.DataContracts/2009/01", Name="FileBinaryData")]
public class FileBinaryData : BinaryData 
C++/CLI 
[DataContractAttribute(Namespace="http://Leadtools.Services.DataContracts/2009/01", Name="FileBinaryData")]
public ref class FileBinaryData : public BinaryData 

Example

This example will convert a TIF file in the source folder to a CMP file in the destination folder.

Visual BasicCopy Code
Public Sub FileBinaryDataExample()
   Dim client As RasterServiceClient = New RasterServiceClient()
   Dim sourceBinaryData As FileBinaryData = New FileBinaryData()
   sourceBinaryData.FileName = LeadtoolsExamples.Common.ImagesPath.Path & "clean.tif"

   Dim destinationBinaryData As FileBinaryData = New FileBinaryData()
   destinationBinaryData.FileName = LeadtoolsExamples.Common.ImagesPath.Path & "clean.cmp"

   Dim convertOptions As RasterConvertOptions = New RasterConvertOptions()

   convertOptions.Source = sourceBinaryData
   convertOptions.Destination = destinationBinaryData
   convertOptions.Format = RasterImageFormat.Cmp
   convertOptions.FirstPage = 1
   convertOptions.LastPage = 1
   convertOptions.BitsPerPixel = 24
   convertOptions.QualityFactor = 2

   Dim request As ConvertRequest = New ConvertRequest()
   request.ConvertOptions = convertOptions

   client.Convert(request)

   client.Close()
End Sub
C#Copy Code
public void FileBinaryDataExample() 

   RasterServiceClient client = new RasterServiceClient(); 
   FileBinaryData sourceBinaryData = new FileBinaryData(); 
   sourceBinaryData.FileName = LeadtoolsExamples.Common.ImagesPath.Path + "clean.tif"; 
 
   FileBinaryData destinationBinaryData = new FileBinaryData(); 
   destinationBinaryData.FileName = LeadtoolsExamples.Common.ImagesPath.Path + "clean.cmp"; 
 
   RasterConvertOptions convertOptions = new RasterConvertOptions(); 
 
   convertOptions.Source = sourceBinaryData; 
   convertOptions.Destination = destinationBinaryData; 
   convertOptions.Format = RasterImageFormat.Cmp; 
   convertOptions.FirstPage = 1; 
   convertOptions.LastPage = 1; 
   convertOptions.BitsPerPixel = 24; 
   convertOptions.QualityFactor = 2; 
 
   ConvertRequest request = new ConvertRequest(); 
   request.ConvertOptions = convertOptions; 
 
   client.Convert(request); 
 
   client.Close(); 
}

Remarks

The LoadData and SaveData methods are called internally to load or save a file specified by FileName from or to a disk.

Inheritance Hierarchy

System.Object
   Leadtools.Services.DataContracts.BinaryData
      Leadtools.Services.DataContracts.FileBinaryData

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

Applications developed with LEADTOOLS WCF components require runtime licenses. Server licensing is required for applications on a server. For more information, refer to: Imaging Pro/Document/Medical Features