←Select platform

LoadMode Property

Summary
Gets and sets the load mode for the LEADTOOLS codec.
Syntax
C#
C++/CLI
Java
Python
public CodecsCodecLoadMode LoadMode { get; set; } 
public CodecsCodecLoadMode getLoadMode() 
public void setLoadMode(CodecsCodecLoadMode value) 
public: 
property CodecsCodecLoadMode LoadMode { 
   CodecsCodecLoadMode get(); 
   void set (    CodecsCodecLoadMode ); 
} 
LoadMode # get and set (CodecsCodecInformation) 

Property Value

The load mode for the LEADTOOLS codec. The default value is Dynamic.

Remarks

The LoadMode affects the behavior of RasterCodecs.Load, RasterCodecs.LoadAsync, RasterCodecs.GetInformation and RasterCodecs.GetInformationAsync. This can be one of three values: Ignored (do not use this codec), Fixed (this codec is always loaded), Dynamic (this codec loads when needed, and unloaded when finished).

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
public void GetCodecInformationExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   CodecsCodecInformation codecInfo = codecs.GetCodecInformation("Tif"); 
   Debug.WriteLine("CheckedByInformation : {0}", codecInfo.CheckedByInformation); 
   Debug.WriteLine("ExtensionList : {0}", codecInfo.ExtensionList); 
   Debug.WriteLine("IsIgnored : {0}", codecInfo.IsIgnored.ToString()); 
   Debug.WriteLine("IsPresent : {0}", codecInfo.IsPresent.ToString()); 
   Debug.WriteLine("IsSlowInformation : {0}", codecInfo.IsSlowInformation.ToString()); 
   Debug.WriteLine("LoadMode : {0}", codecInfo.LoadMode.ToString()); 
   Debug.WriteLine("Name : {0}", codecInfo.Name); 
 
   // Parse the load modes 
   CodecsCodecLoadMode[] loadModes = (CodecsCodecLoadMode[])Enum.GetValues(typeof(CodecsCodecLoadMode)); 
   foreach (var loadMode in loadModes) 
   { 
      codecs.SetCodecsInformation(codecs.GetCodecsInformation()); 
      Debug.WriteLine($"Load mode: {loadMode}"); 
   } 
 
   // change the extensions that the ptk filter tries to handle 
   codecInfo.ExtensionList = "ptk;ptoka;ptoca;ptca;ptka"; 
   codecs.SetCodecInformation(codecInfo); 
 
   // re-display the new settings 
   codecInfo = codecs.GetCodecInformation("tif"); 
   Debug.WriteLine("ExtensionList : {0}", codecInfo.ExtensionList); 
 
   // Clean up 
   codecs.Dispose(); 
} 
 
import java.io.*; 
import java.net.*; 
import java.nio.file.Paths; 
import java.util.*; 
import java.time.Instant; 
import java.time.Duration; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.codecs.RasterCodecs.FeedCallbackThunk; 
import leadtools.drawing.internal.*; 
import leadtools.imageprocessing.*; 
import leadtools.imageprocessing.color.ChangeIntensityCommand; 
import leadtools.svg.*; 
 
 
public void getCodecInformationExample() { 
   RasterCodecs codecs = new RasterCodecs(); 
 
   CodecsCodecInformation codecInfo = codecs.getCodecInformation("Tif"); 
   System.out.println("CheckedByInformation : " + codecInfo.getCheckedByInformation()); 
   System.out.println("ExtensionList : %s" + codecInfo.getExtensionList()); 
   System.out.println("IsIgnored : %s" + codecInfo.isIgnored()); 
   System.out.println("IsPresent : %s" + codecInfo.isPresent()); 
   System.out.println("IsSlowInformation : %s" + codecInfo.isSlowInformation()); 
   System.out.println("LoadMode : %s" + codecInfo.getLoadMode().toString()); 
   System.out.println("Name : %s" + codecInfo.getName()); 
 
   // Parse the load modes 
   CodecsCodecLoadMode[] loadModes = CodecsCodecLoadMode.values(); 
   for (CodecsCodecLoadMode loadMode : loadModes) { 
      codecs.setCodecsInformation(codecs.getCodecsInformation()); 
      assertTrue("Codecs information unsuccessfully set (is null)", codecs.getCodecsInformation() != null); 
      System.out.println("Load mode: " + loadMode); 
   } 
 
   // change the extensions that the ptk filter tries to handle 
   codecInfo.setExtensionList("ptk;ptoka;ptoca;ptca;ptka"); 
   codecs.setCodecInformation(codecInfo); 
 
   // re-display the new settings 
   codecInfo = codecs.getCodecInformation("tif"); 
   System.out.println("ExtensionList : " + codecInfo.getExtensionList()); 
 
   // Clean up 
   codecs.dispose(); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.