Provides extra options for loading and saving ECW images.
Object Model
Syntax
Visual Basic (Declaration) | |
---|
Public Class CodecsEcwOptions |
C# | |
---|
public class CodecsEcwOptions |
C++/CLI | |
---|
public ref class CodecsEcwOptions |
Example
Visual Basic | Copy Code |
---|
Public Sub CodecsEcwOptionsExample()
RasterCodecs.Startup()
Dim codecs As RasterCodecs = New RasterCodecs()
Dim srcFileName As String = LeadtoolsExamples.Common.ImagesPath.Path + "OCR1.TIF"
Dim srcImage As RasterImage = codecs.Load(srcFileName)
codecs.Options.Ecw.Save.QualityFactor = 1
codecs.Save(srcImage, LeadtoolsExamples.Common.ImagesPath.Path + "quality.ecw", RasterImageFormat.Ecw, srcImage.BitsPerPixel)
codecs.Options.Ecw.Save.QualityFactor = 100
codecs.Save(srcImage, LeadtoolsExamples.Common.ImagesPath.Path + "compression.ecw", RasterImageFormat.Ecw, srcImage.BitsPerPixel)
codecs.Options.Ecw.Load.Resolution = New Size(200, 200)
Dim smallImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "quality.ecw")
smallImage.Dispose()
srcImage.Dispose()
codecs.Dispose()
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
public void CodecsEcwOptionsExample() { RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); string srcFileName = LeadtoolsExamples.Common.ImagesPath.Path + "OCR1.TIF"; // Load the image RasterImage srcImage = codecs.Load(srcFileName); // save with maximum quality codecs.Options.Ecw.Save.QualityFactor = 1; codecs.Save(srcImage, LeadtoolsExamples.Common.ImagesPath.Path + "quality.ecw", RasterImageFormat.Ecw, srcImage.BitsPerPixel); // save with maximum compression codecs.Options.Ecw.Save.QualityFactor = 100; codecs.Save(srcImage, LeadtoolsExamples.Common.ImagesPath.Path + "compression.ecw", RasterImageFormat.Ecw, srcImage.BitsPerPixel); // load a small resolution codecs.Options.Ecw.Load.Resolution = new Size(200, 200); RasterImage smallImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "quality.ecw"); // Clean up srcImage.Dispose(); smallImage.Dispose(); codecs.Dispose(); RasterCodecs.Shutdown(); } |
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also