Copies the metadata (tags, comments, and markers) to the given image.
public void CopyMetadataTo(RasterImage image,RasterMetadataFlags flags)
Public Sub CopyMetadataTo( _ByVal image As Leadtools.RasterImage, _ByVal flags As Leadtools.RasterMetadataFlags _)
public void CopyMetadataTo(Leadtools.RasterImage image,Leadtools.RasterMetadataFlags flags)
function Leadtools.RasterImage.CopyMetadataTo(image ,flags)
public:void CopyMetadataTo(Leadtools.RasterImage^ image,Leadtools.RasterMetadataFlags flags)
image
Destination image
flags
Type of metadata to copy
This methods copies the metadata found in the Tags, Comments and/or Markers collections of this RasterImage to image.
Before the copy operation, this method will clear any metadata already found in image.
For more information on GeoKeys, refer to Implementing GeoKeys (GeoTIFF tags).
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 CopyMetadataToExample(){RasterCodecs codecs = new RasterCodecs();// load 2 TIF imagesRasterImage image1 = codecs.Load(Path.Combine(ImagesPath.Path, "OCR1.TIF"));RasterImage image2 = codecs.Load(Path.Combine(ImagesPath.Path, "OCR2.TIF"));// show the number of tags in each imageMessageBox.Show(string.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count));// add a few tags to the first imageRasterTagMetadata tag = new RasterTagMetadata(RasterTagMetadata.Copyright, RasterTagMetadataDataType.Byte, new byte[] { 1, 2, 3 });image1.Tags.Add(tag);tag = new RasterTagMetadata(RasterTagMetadata.ExifGps, RasterTagMetadataDataType.Byte, new byte[] { 4, 5, 6 });image1.Tags.Add(tag);// show the number of tags in each imageMessageBox.Show(string.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count));// copy the tags from first image to the secondimage1.CopyMetadataTo(image2, RasterMetadataFlags.Tags);// show the number of tags in each imageMessageBox.Show(string.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count));image1.Dispose();image2.Dispose();codecs.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.CoreImports Leadtools.ImageProcessing.ColorImports Leadtools.ControlsImports Leadtools.DicomImports Leadtools.DrawingImports Leadtools.SvgPublic Sub CopyMetadataToExample()Dim codecs As RasterCodecs = New RasterCodecs()' load 2 TIF imagesDim image1 As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "OCR1.TIF"))Dim image2 As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "OCR2.TIF"))' show the number of tags in each imageMessageBox.Show(String.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count))' add a few tags to the first imageDim tag As RasterTagMetadata = New RasterTagMetadata(RasterTagMetadata.Copyright, RasterTagMetadataDataType.Byte, New Byte() {1, 2, 3})image1.Tags.Add(tag)tag = New RasterTagMetadata(RasterTagMetadata.ExifGps, RasterTagMetadataDataType.Byte, New Byte() {4, 5, 6})image1.Tags.Add(tag)' show the number of tags in each imageMessageBox.Show(String.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count))' copy the tags from first image to the secondimage1.CopyMetadataTo(image2, RasterMetadataFlags.Tags)' show the number of tags in each imageMessageBox.Show(String.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count))image1.Dispose()image2.Dispose()codecs.Dispose()End SubPublic NotInheritable Class LEAD_VARSPublic 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 CopyMetadataToExample(RasterImage image1, RasterImage image2){// images should be 2 TIF images// show the number of tags in each imageDebug.WriteLine(string.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count));// add a few tags to the first imageRasterTagMetadata tag = new RasterTagMetadata(RasterTagMetadata.Copyright, RasterTagMetadataDataType.Byte, new byte[] { 1, 2, 3 });image1.Tags.Add(tag);tag = new RasterTagMetadata(RasterTagMetadata.ExifGps, RasterTagMetadataDataType.Byte, new byte[] { 4, 5, 6 });image1.Tags.Add(tag);// show the number of tags in each imageDebug.WriteLine(string.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count));// copy the tags from first image to the secondimage1.CopyMetadataTo(image2, RasterMetadataFlags.Tags);// show the number of tags in each imageDebug.WriteLine(string.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count));image1.Dispose();image2.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.DicomImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.CoreImports Leadtools.ImageProcessing.ColorImports Leadtools.Windows.MediaPublic Sub CopyMetadataToExample(ByVal image1 As RasterImage, ByVal image2 As RasterImage)' images should be 2 TIF images' show the number of tags in each imageDebug.WriteLine(String.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count))' add a few tags to the first imageDim tag As RasterTagMetadata = New RasterTagMetadata(RasterTagMetadata.Copyright, RasterTagMetadataDataType.Byte, New Byte() {1, 2, 3})image1.Tags.Add(tag)tag = New RasterTagMetadata(RasterTagMetadata.ExifGps, RasterTagMetadataDataType.Byte, New Byte() {4, 5, 6})image1.Tags.Add(tag)' show the number of tags in each imageDebug.WriteLine(String.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count))' copy the tags from first image to the secondimage1.CopyMetadataTo(image2, RasterMetadataFlags.Tags)' show the number of tags in each imageDebug.WriteLine(String.Format("Tags in image1: {0}, tags in image2: {1}", image1.Tags.Count, image2.Tags.Count))image1.Dispose()image2.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
