Indicates the end of a section of code using the same source file.
public void StopOptimizedLoad() Public Sub StopOptimizedLoad() public void StopOptimizedLoad() function Leadtools.Codecs.RasterCodecs.StopOptimizedLoad() public:void StopOptimizedLoad();
Speeds up multi-page load Call this method when you have finished loading or converting from the same source file (or when the source file contents have changed). Call StopOptimizedLoad after calling StartOptimizedLoad.
For more information, refer to Using the OptimizedLoad Functions to Speed Loading Large Files.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Svg;using LeadtoolsExamples.Common;public void OptimizedLoadExample(){using (RasterCodecs codecs = new RasterCodecs()){// The speed improvement is most noticeable in source files with many pagesstring srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "MultiPage.pdf");// indicate the start of a loop from the same source filecodecs.StartOptimizedLoad();for (int i = 1; i < 10; i++){using (RasterImage image = codecs.Load(srcFileName, i)){string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "out_" + i.ToString() + ".jpg");// Save as the destination imagecodecs.Save(image, destFileName, RasterImageFormat.Jpeg411, 24);}}// Indicate that I finished using the same source file.codecs.StopOptimizedLoad();}}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingImports Leadtools.SvgPublic Sub OptimizedLoadExample()Using codecs As RasterCodecs = New RasterCodecs()' The speed improvement is most noticeable in source files with many pagesDim srcFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "MultiPage.pdf")' indicate the start of a loop from the same source filecodecs.StartOptimizedLoad()For i As Integer = 1 To 10Using image As RasterImage = codecs.Load(srcFileName, i)Dim destFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "out_" + i.ToString() + ".jpg")' Save as the destination imagecodecs.Save(image, destFileName, RasterImageFormat.Jpeg411, 24)End UsingNext' Indicate that I finished using the same source file.codecs.StopOptimizedLoad()End UsingEnd SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
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
