Specifies the file format codecs to be loaded.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RasterCodecs
Dim fixedCodecs As Integer
Dim cachedCodecs As Integer
Dim codecs As String
instance.PreloadCodecs(fixedCodecs, cachedCodecs, codecs)
|
Parameters
- fixedCodecs
- Number of codecs that should stay loaded in memory at all times.
- cachedCodecs
- Number of codecs that should be loaded, but can be unloaded later to make room for other
codecs.
- codecs
- A String containing the codecs which should be loaded.
Example
Visual Basic | Copy Code |
---|
RasterCodecs.PreloadCodecs
Public Sub PreloadCodecsExample()
RasterCodecs.Startup()
Dim codecs As RasterCodecs = New RasterCodecs()
Dim srcFileName1 As String = "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image1.j2k"
Dim srcFileName2 As String = "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image1.cmp"
Console.WriteLine("PreloadCodecList - {0}", codecs.PreloadCodecsList)
Console.WriteLine("FixedPreloadCodecs - {0}", codecs.FixedPreloadCodecs)
Console.WriteLine("CachedPreloadCodecs - {0}", codecs.CachedPreloadCodecs)
Console.WriteLine("IgnoreCodecList - {0}", codecs.IgnoreCodecsList)
codecs.PreloadCodecs(1, 1, "j2k")
codecs.IgnoreCodecs("cmp")
Dim info As CodecsImageInfo = codecs.GetInformation(srcFileName1, False)
Console.WriteLine("j2k - Width: {0}, Height {1}", info.Width, info.Height)
Try
info = codecs.GetInformation(srcFileName2, False)
Catch
Console.WriteLine("GetInformation for cmp failed - sample success!")
End Try
codecs.Dispose()
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
RasterCodecs.PreloadCodecs public void PreloadCodecsExample() { RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); string srcFileName1 = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image1.j2k"; string srcFileName2 = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image1.cmp"; // display the original values before changing them Console.WriteLine("PreloadCodecList - {0}", codecs.PreloadCodecsList); Console.WriteLine("FixedPreloadCodecs - {0}", codecs.FixedPreloadCodecs); Console.WriteLine("CachedPreloadCodecs - {0}", codecs.CachedPreloadCodecs); Console.WriteLine("IgnoreCodecList - {0}", codecs.IgnoreCodecsList); // preload only the j2k filter and ignore the cmp filter codecs.PreloadCodecs(1, 1, "j2k"); codecs.IgnoreCodecs("cmp"); // try to get info on a j2k image CodecsImageInfo info = codecs.GetInformation(srcFileName1, false); Console.WriteLine("j2k - Width: {0}, Height {1}", info.Width, info.Height); // try to get info on a cmp image try { info = codecs.GetInformation(srcFileName2, false); } catch { Console.WriteLine("GetInformation for cmp failed - sample success!"); } // Clean up codecs.Dispose(); RasterCodecs.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also