The collection of marker data used when reading and writing certain file formats (including JPEG).
public Leadtools.RasterCollection<RasterMarkerMetadata> Markers {get;}
Public ReadOnly Property Markers As Leadtools.RasterCollection(Of RasterMarkerMetadata)
public Leadtools.RasterCollection<RasterMarkerMetadata> Markers {get;}
@property (nonatomic, assign, readonly, nullable) NSMutableArray<LTRasterMarkerMetadata *> *markers
public RasterCollection<RasterMarkerMetadata> getMarkers()
get_Markers();
public:
property Leadtools.RasterCollection<RasterMarkerMetadata^>^ Markers {
Leadtools.RasterCollection<RasterMarkerMetadata^>^ get();
}
A collection of RasterMarkerMetadata used when reading and writing certain file formats (including JPEG).
Several formats allow you to store non-image data such as comments, tags, and markers.
You can manipulate the markers of an image by adding/removing RasterMarkerMetadata objects to this collection.
By setting the CodecsSaveOptions.Markers property to true before calling RasterCodecs.Save, you can save the markers in this collection when the image is saved into a file.
By setting the CodecsLoadOptions.Markers property to true before calling RasterCodecs.Load, you can load all the markers (if any) into this collection when an image is loaded from a file.
You can use the RasterCodecs.ReadMarkers method to load the markers directly from an existing file and the RasterCodecs.WriteMarkers method to save the markers to an existing file.
For more information, refer to Non Image Data.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Dicom;
using Leadtools.Drawing;
using Leadtools.Controls;
using LeadtoolsExamples.Common;
using Leadtools.Svg;
public void MarkersExample()
{
RasterCodecs codecs = new RasterCodecs();
RasterImage image = codecs.Load(Path.Combine(ImagesPath.Path, "IMAGE1.CMP"));
byte[] byteData = new byte[1];
byteData[0] = 40;
// write APP5 (since nobody writes that)
RasterMarkerMetadata markerData = new RasterMarkerMetadata(RasterMarkerMetadata.App0 + 5, byteData);
image.Markers.Add(markerData);
codecs.Options.Save.Markers = true;
codecs.Save(image, Path.Combine(ImagesPath.Path, "IMAGE1_MARKERS.JPG"), RasterImageFormat.Jpeg, 0);
// load the marker together with the image
RasterCollection<RasterMarkerMetadata> marker = codecs.ReadMarkers(Path.Combine(ImagesPath.Path, "IMAGE1_MARKERS.JPG"));
// look for the APP5 marker, because there might be other markers (like APP0, APP1)
foreach (RasterMarkerMetadata markerItem in marker)
if (markerItem.Id == RasterMarkerMetadata.App0 + 5)
MessageBox.Show("marker Id :" + markerItem.Id.ToString() + " = " + markerItem.GetData().ToString());
codecs.Dispose();
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Controls
Imports Leadtools.Dicom
Imports Leadtools.Drawing
Imports Leadtools.Svg
Public Sub MarkersExample()
Dim codecs As RasterCodecs = New RasterCodecs()
Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1.CMP"))
Dim byteData As Byte() = New Byte(0) {}
byteData(0) = 40
' write APP5 (since nobody writes that)
Dim markerData As RasterMarkerMetadata = New RasterMarkerMetadata(RasterMarkerMetadata.App0 + 5, byteData)
image.Markers.Add(markerData)
codecs.Options.Save.Markers = True
codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1_MARKERS.JPG"), RasterImageFormat.Jpeg, 0)
' load the marker together with the image
Dim marker As RasterCollection(Of RasterMarkerMetadata) = codecs.ReadMarkers(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1_MARKERS.JPG"))
' look for the APP5 marker, because there might be other markers (like APP0, APP1)
For Each markerItem As RasterMarkerMetadata In marker
If markerItem.Id = RasterMarkerMetadata.App0 + 5 Then
MessageBox.Show("marker Id :" & markerItem.Id.ToString() & " = " & markerItem.GetData().ToString())
End If
Next markerItem
codecs.Dispose()
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Dicom;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Examples;
using Leadtools.Windows.Media;
public void MarkersExample(RasterImage image, Stream destStream)
{
byte[] byteData = new byte[1];
byteData[0] = 40;
// write APP5 (since nobody writes that)
RasterMarkerMetadata markerData = new RasterMarkerMetadata(RasterMarkerMetadata.App0 + 5, byteData);
image.Markers.Add(markerData);
RasterCodecs codecs = new RasterCodecs();
codecs.Options.Save.Markers = true;
codecs.Save(image, destStream, RasterImageFormat.Jpeg, 0);
// load the marker together with the image
RasterCollection<RasterMarkerMetadata> marker = codecs.ReadMarkers(destStream);
// look for the APP5 marker, because there might be other markers (like APP0, APP1)
foreach (RasterMarkerMetadata markerItem in marker)
if (markerItem.Id == RasterMarkerMetadata.App0 + 5)
Debug.WriteLine("marker Id :" + markerItem.Id.ToString() + " = " + markerItem.GetData().ToString());
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Dicom
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Windows.Media
Public Sub MarkersExample(ByVal image As RasterImage, ByVal destStream As Stream)
Dim byteData As Byte() = New Byte(0) {}
byteData(0) = 40
' write APP5 (since nobody writes that)
Dim markerData As RasterMarkerMetadata = New RasterMarkerMetadata(RasterMarkerMetadata.App0 + 5, byteData)
image.Markers.Add(markerData)
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.Options.Save.Markers = True
codecs.Save(image, destStream, RasterImageFormat.Jpeg, 0)
' load the marker together with the image
Dim marker As RasterCollection(Of RasterMarkerMetadata) = codecs.ReadMarkers(destStream)
' look for the APP5 marker, because there might be other markers (like APP0, APP1)
For Each markerItem As RasterMarkerMetadata In marker
If markerItem.Id = RasterMarkerMetadata.App0 + 5 Then
Debug.WriteLine("marker Id :" & markerItem.Id.ToString() & " = " & markerItem.GetData().ToString())
End If
Next markerItem
End Sub
Products |
Support |
Feedback: Markers Property - Leadtools |
Introduction |
Help Version 19.0.2017.6.19
|
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.