Markers Property (original) (raw)
Summary
The collection of marker data used when reading and writing certain file formats (including JPEG).
Syntax
C#
Objective-C
C++/CLI
Java
Python
@property (nonatomic, assign, readonly, nullable) NSMutableArray<LTRasterMarkerMetadata *> *markers
Property Value
A collection of RasterMarkerMetadata used when reading and writing certain file formats (including JPEG).
Example
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 Leadtools.Svg;
public void MarkersExample()
{
RasterCodecs codecs = new RasterCodecs();
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "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(LEAD_VARS.ImagesDir, "IMAGE1_MARKERS.JPG"), RasterImageFormat.Jpeg, 0);
// load the marker together with the image
IList<RasterMarkerMetadata> marker = codecs.ReadMarkers(Path.Combine(LEAD_VARS.ImagesDir, "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)
Console.WriteLine("marker Id :" + markerItem.Id.ToString() + " = " + markerItem.GetData().ToString());
codecs.Dispose();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Leadtools Assembly