Leadtools.Codecs Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.17
ReadMarkers Method
See Also  Example
Leadtools.Codecs Namespace > RasterCodecs Class : ReadMarkers Method




Reads all the metadata markers (COM and APPn) from a file.

Overload List

OverloadDescription
ReadMarkers(String) Reads all the metadata markers (COM and APPn) from a file.  
ReadMarkers(Stream) Reads all the metadata markers (COM and APPn) from a stream.  

Example

Visual BasicCopy Code
RasterCodecs.ReadMarkers(string)
      Private Sub ReadMarkersFromFileExample(ByVal exifFileName As String)
         RasterCodecs.Startup()
         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()
         RasterCodecs.Shutdown()
      End Sub
C#Copy Code
RasterCodecs.ReadMarkers(string) 
      void ReadMarkersFromFileExample(string exifFileName) 
      { 
         RasterCodecs.Startup(); 
         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(); 
         RasterCodecs.Shutdown(); 
      }

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.

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