LEADTOOLS Image File Support (Leadtools.Codecs assembly)
LEAD Technologies, Inc

ReadMarkers(String) Method

Example 





A System.String containing the input file name.
Reads all the metadata markers (COM and APPn) from a file. .NET support Silverlight support
Syntax
'Declaration
 
Public Overloads Function ReadMarkers( _
   ByVal fileName As String _
) As RasterCollection(Of RasterMarkerMetadata)
'Usage
 
Dim instance As RasterCodecs
Dim fileName As String
Dim value As RasterCollection(Of RasterMarkerMetadata)
 
value = instance.ReadMarkers(fileName)
 function Leadtools.Codecs.RasterCodecs.ReadMarkers(String)( 
   fileName 
)

Parameters

fileName
A System.String containing the input file name.

Return Value

A collection of Leadtools.RasterMarkerMetadata objects containing the metadata marker data.
Remarks

This method reads all the metadata markers from a file, and returns a collection of the markers.

For Exif files, this metadata collection will contain all the Exif and GPS comments, stored in APP1. It will also contain the audio information stored in APP2.

If the file contains no marker, then this method will return an empty collection.

Example
 
Private Sub ReadMarkersFromFileExample(ByVal exifFileName As String)
   Dim codecs As RasterCodecs = New RasterCodecs()
   Dim markers As RasterCollection(Of RasterMarkerMetadata) = codecs.ReadMarkers(exifFileName)
   Console.WriteLine("{0} markers found with the following ID's:", markers.Count)
   For Each marker As RasterMarkerMetadata In markers
      Console.WriteLine(marker.Id)
   Next marker

   codecs.Dispose()
End Sub
void ReadMarkersFromFileExample(string exifFileName)
{
    RasterCodecs codecs = new RasterCodecs();
    RasterCollection<RasterMarkerMetadata> markers = codecs.ReadMarkers(exifFileName);
    Console.WriteLine("{0} markers found with the following ID's:", markers.Count);
    foreach (RasterMarkerMetadata marker in markers)
        Console.WriteLine(marker.Id);

    codecs.Dispose();
}
RasterCodecsExamples.prototype.ReadMarkersFileExample = function () {
   Tools.SetLicense();
   with (Leadtools) {
      with (Leadtools.Codecs) {

         var exifFileName = "Assets\\WithAudio.jpg";
         var codecs = new RasterCodecs();

         return Tools.AppInstallFolder().getFileAsync(exifFileName).then(function (loadFile) {

            return codecs.readMarkersAsync(LeadStreamFactory.create(loadFile))
         })
            .then(function (markers) {
               console.info(markers.length, " markers found with the following ID's:");
               for (var i =0; i < markers.length; i++ )
                  console.info(markers[i].id);

               codecs.close();
            });
      }
   }
}
async Task ReadMarkersFromFileExample(string exifFileName)
{
   RasterCodecs codecs = new RasterCodecs();
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(exifFileName);
   IList<RasterMarkerMetadata> markers = await codecs.ReadMarkersAsync(LeadStreamFactory.Create(loadFile));
   Debug.WriteLine("{0} markers found with the following ID's:", markers.Count);
   foreach (RasterMarkerMetadata marker in markers)
      Debug.WriteLine(marker.Id);

   codecs.Dispose();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RasterCodecs Class
RasterCodecs Members
Overload List
Working with Markers

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.