Writes a marker to an existing file.
public void WriteMarker(string fileName,int pageNumber,RasterMarkerMetadata marker)
Public Overloads Sub WriteMarker( _ByVal fileName As String, _ByVal pageNumber As Integer, _ByVal marker As Leadtools.RasterMarkerMetadata _)
public void WriteMarker(string fileName,int pageNumber,Leadtools.RasterMarkerMetadata marker)
- (BOOL)writeMarker:(nullable LTRasterMarkerMetadata *)markertoFile:(NSString *)filepageNumber:(NSInteger)pageNumbererror:(NSError **)error
function Leadtools.Codecs.RasterCodecs.WriteMarker(String,Int32,RasterMarkerMetadata)(fileName ,pageNumber ,marker)
public:void WriteMarker(String^ fileName,int pageNumber,Leadtools.RasterMarkerMetadata^ marker)
fileName
A String that contains the file name.
pageNumber
1-based index of the page at which to write the marker.
marker
A RasterMarkerMetadata object that contains the marker data.
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.
When you add or remove tags, the tags array at the end of the file is re-written. When you modify existing tags, the new tag value is added to the file and the IFD is modified as necessary. In all of these cases, there is no image recompression.
This example read the markers from a source file and saving them to a destination file
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Svg;using LeadtoolsExamples.Common;void MarkersExample(string srcFileName, string destFileName){RasterCodecs codecs = new RasterCodecs();// Load the source image with markersConsole.WriteLine("Loading the source image with all markers");codecs.Options.Load.Markers = true;RasterImage srcImage = codecs.Load(srcFileName);// Show the markers loadedConsole.WriteLine("These markers were loaded:");foreach (RasterMarkerMetadata marker in srcImage.Markers){byte[] data = marker.GetData();Console.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length);}// Create the destination imageRasterImage destImage = new RasterImage(RasterMemoryFlags.Conventional,320,20,24,RasterByteOrder.Bgr,RasterViewPerspective.TopLeft,null,IntPtr.Zero,0);// Save this as JPEGcodecs.Save(destImage, destFileName, RasterImageFormat.Jpeg, 24);// Write the markers from the source image to this destination imageConsole.WriteLine("Writing the markers to the destination file");codecs.WriteMarkers(destFileName, 1, srcImage.Markers);srcImage.Dispose();destImage.Dispose();// Re-load the destination image with markersConsole.WriteLine("Loading the destination image with all markers");codecs.Options.Load.Markers = true;destImage = codecs.Load(destFileName);// Show the markers loadedConsole.WriteLine("These markers were loaded:");foreach (RasterMarkerMetadata marker in destImage.Markers){byte[] data = marker.GetData();Console.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length);}destImage.Dispose();// Clean upcodecs.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingImports Leadtools.SvgPrivate Sub MarkersExample(ByVal srcFileName As String, ByVal destFileName As String)Dim codecs As RasterCodecs = New RasterCodecs()' Load the source image with markersConsole.WriteLine("Loading the source image with all markers")codecs.Options.Load.Markers = TrueDim srcImage As RasterImage = codecs.Load(srcFileName)' Show the markers loadedConsole.WriteLine("These markers were loaded:")For Each marker As RasterMarkerMetadata In srcImage.MarkersDim data As Byte() = marker.GetData()Console.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length)Next marker' Create the destination imageDim destImage As RasterImage = New RasterImage(RasterMemoryFlags.Conventional, 320, 20, 24, RasterByteOrder.Bgr, RasterViewPerspective.TopLeft, Nothing, IntPtr.Zero, 0)' Save this as JPEGcodecs.Save(destImage, destFileName, RasterImageFormat.Jpeg, 24)' Write the markers from the source image to this destination imageConsole.WriteLine("Writing the markers to the destination file")codecs.WriteMarkers(destFileName, 1, srcImage.Markers)srcImage.Dispose()destImage.Dispose()' Re-load the destination image with markersConsole.WriteLine("Loading the destination image with all markers")codecs.Options.Load.Markers = TruedestImage = codecs.Load(destFileName)' Show the markers loadedConsole.WriteLine("These markers were loaded:")For Each marker As RasterMarkerMetadata In destImage.MarkersDim data As Byte() = marker.GetData()Console.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length)Next markerdestImage.Dispose()' Clean upcodecs.Dispose()End Sub
using Leadtools;using Leadtools.Codecs;using Leadtools.Examples;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Windows.Media;void MarkersExample(Stream inStreamExif, Stream outStreamJpg){RasterCodecs codecs = new RasterCodecs();// Load the source image with markersDebug.WriteLine("Loading the source image with all markers");codecs.Options.Load.Markers = true;RasterImage srcImage = codecs.Load(inStreamExif);// Show the markers loadedDebug.WriteLine("These markers were loaded:");foreach (RasterMarkerMetadata marker in srcImage.Markers){byte[] data = marker.GetData();Debug.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length);}// Create the destination imageRasterImage destImage = new RasterImage(RasterMemoryFlags.Conventional,320,20,24,RasterByteOrder.Bgr,RasterViewPerspective.TopLeft,null,null,0);// Save this as JPEGcodecs.Save(destImage, outStreamJpg, RasterImageFormat.Jpeg, 24);// Write the markers from the source image to this destination imageDebug.WriteLine("Writing the markers to the destination file");codecs.WriteMarkers(outStreamJpg, 1, srcImage.Markers);srcImage.Dispose();destImage.Dispose();// Re-load the destination image with markersDebug.WriteLine("Loading the destination image with all markers");codecs.Options.Load.Markers = true;destImage = codecs.Load(outStreamJpg);// Show the markers loadedDebug.WriteLine("These markers were loaded:");foreach (RasterMarkerMetadata marker in destImage.Markers){byte[] data = marker.GetData();Debug.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length);}destImage.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.Windows.MediaPrivate Sub MarkersExample(ByVal inStreamExif As Stream, ByVal outStreamJpg As Stream)Dim codecs As RasterCodecs = New RasterCodecs()' Load the source image with markersDebug.WriteLine("Loading the source image with all markers")codecs.Options.Load.Markers = TrueDim srcImage As RasterImage = codecs.Load(inStreamExif)' Show the markers loadedDebug.WriteLine("These markers were loaded:")For Each marker As RasterMarkerMetadata In srcImage.MarkersDim data As Byte() = marker.GetData()Debug.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length)Next marker' Create the destination imageDim destImage As RasterImage = New RasterImage(RasterMemoryFlags.Conventional, 320, 20, 24, RasterByteOrder.Bgr, RasterViewPerspective.TopLeft, Nothing, Nothing, 0)' Save this as JPEGcodecs.Save(destImage, outStreamJpg, RasterImageFormat.Jpeg, 24)' Write the markers from the source image to this destination imageDebug.WriteLine("Writing the markers to the destination file")codecs.WriteMarkers(outStreamJpg, 1, srcImage.Markers)srcImage.Dispose()destImage.Dispose()' Re-load the destination image with markersDebug.WriteLine("Loading the destination image with all markers")codecs.Options.Load.Markers = TruedestImage = codecs.Load(outStreamJpg)' Show the markers loadedDebug.WriteLine("These markers were loaded:")For Each marker As RasterMarkerMetadata In destImage.MarkersDim data As Byte() = marker.GetData()Debug.WriteLine(" {0}, DataSize:{1}", marker.Id, data.Length)Next markerdestImage.Dispose()End Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
