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



stream
A Stream containing the input file image data.
Reads all the metadata markers (COM and APPn) from a stream.

Syntax

Visual Basic (Declaration) 
Public Overloads Function ReadMarkers( _
   ByVal stream As Stream _
) As RasterCollection(Of RasterMarkerMetadata)
Visual Basic (Usage)Copy Code
Dim instance As RasterCodecs
Dim stream As Stream
Dim value As RasterCollection(Of RasterMarkerMetadata)
 
value = instance.ReadMarkers(stream)
C# 
public RasterCollection<RasterMarkerMetadata> ReadMarkers( 
   Stream stream
)
C++/CLI 
public:
RasterCollection<RasterMarkerMetadata> ReadMarkers( 
   Stream^ stream
) 

Parameters

stream
A Stream containing the input file image data.

Return Value

A collection of RasterMarkerMetadata objects containing the metadata marker data.

Example

This example will read all the markers from a stream that contains an EXIF file data

Visual BasicCopy Code
Private Sub ReadMarkersFromStreamExample(ByVal theStream As Stream)
   RasterCodecs.Startup()
   Dim codecs As RasterCodecs = New RasterCodecs()
   Dim markers As RasterCollection(Of RasterMarkerMetadata) = codecs.ReadMarkers(theStream)
   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
void ReadMarkersFromStreamExample(Stream theStream) 

   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   RasterCollection<RasterMarkerMetadata> markers = codecs.ReadMarkers(theStream); 
   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 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also