public static void Save(string fileName,AnnBatesStampComposer composer)
Public Overloads Shared Sub Save( _ByVal fileName As String, _ByVal composer As AnnBatesStampComposer _)
public:static void Save(String^ fileName,AnnBatesStampComposer^ composer)
fileName
Destination file name to save the data to.
composer
The AnnBatesStampComposer to be saved. This value must not be null.
This example will create Bates stamp composer , save it to file and load it from file again.
using Leadtools.Annotations.Engine;using Leadtools.Annotations.Automation;using Leadtools.Annotations.Rendering;using Leadtools.Annotations.WinForms;using Leadtools.Annotations.BatesStamp;public void AnnBatesStampComposer_SaveLoad(){//Create Bates stamp object to be used on our testAnnBatesStamp batesStamp = new AnnBatesStamp();batesStamp.Elements.Add(new AnnBatesNumber());//Create Bates stamp composer that we want to save and loadAnnBatesStampComposer composer = new AnnBatesStampComposer();//Create new container and attach it to the Bates stamp composer to stamp it.AnnContainer batesStampContainer = new AnnContainer();composer.TargetContainers.Add(batesStampContainer);composer.Stamps.Add(batesStamp);//Print the contents of Bates stamp objectDebug.WriteLine(composer.Stamps[0].AsString(batesStampContainer)); // the output will be "000001"//temp file to save on , if the file is not existing , it will be created on specfied pathstring tempFile = Path.Combine(LEAD_VARS.ImagesDir, "temp.xml");//Save the composer to the temp file then load it againAnnBatesStampComposer.Save(tempFile, composer);AnnBatesStampComposer loadedComposer = AnnBatesStampComposer.Load(tempFile);loadedComposer.TargetContainers.Add(batesStampContainer);//Print the contents of Bates stamp object again to make sure the load is correct.Debug.WriteLine(loadedComposer.Stamps[0].AsString(batesStampContainer)); // the output will be "000001"}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";}
Imports LeadtoolsImports Leadtools.Annotations.EngineImports Leadtools.Annotations.AutomationImports Leadtools.Annotations.RenderingImports Leadtools.Annotations.WinFormsImports Leadtools.Annotations.BatesStampImports LeadtoolsExamples.CommonPublic Sub AnnBatesStampComposer_SaveLoad()'Create Bates stamp object to be used on our testDim batesStamp As AnnBatesStamp = New AnnBatesStamp()batesStamp.Elements.Add(New AnnBatesNumber())'Create Bates stamp composer that we want to save and loadDim composer As AnnBatesStampComposer = New AnnBatesStampComposer()'Create new container and attach it to the Bates stamp composer to stamp it.Dim batesStampContainer As AnnContainer = New AnnContainer()composer.TargetContainers.Add(batesStampContainer)composer.Stamps.Add(batesStamp)'Print the contents of Bates stamp objectDebug.WriteLine(composer.Stamps(0).AsString(batesStampContainer)) ' the output will be "000001"'temp file to save on , if the file is not existing , it will be created on spcefied pathDim tempFile As String = Path.Combine(ImagesPath.Path, "temp.xml")'Save the composer to the temp file then load it againAnnBatesStampComposer.Save(tempFile, composer)Dim loadedComposer As AnnBatesStampComposer = AnnBatesStampComposer.Load(tempFile)loadedComposer.TargetContainers.Add(batesStampContainer)'Print the contents of Bates stamp object again to make sure the load is correct.Debug.WriteLine(loadedComposer.Stamps(0).AsString(batesStampContainer)) ' the output will be "000001"End Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
