Leadtools.Codecs Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
CodecsEcwOptions Class
See Also  Members   Example 
Leadtools.Codecs Namespace : CodecsEcwOptions Class



Provides extra options for loading and saving ECW images.

Object Model



Syntax

Visual Basic (Declaration) 
Public Class CodecsEcwOptions 
Visual Basic (Usage)Copy Code
Dim instance As CodecsEcwOptions
C# 
public class CodecsEcwOptions 
C++/CLI 
public ref class CodecsEcwOptions 

Example

Visual BasicCopy Code
Public Sub CodecsEcwOptionsExample()
   RasterCodecs.Startup()
   Dim codecs As RasterCodecs = New RasterCodecs()

   Dim srcFileName As String = LeadtoolsExamples.Common.ImagesPath.Path + "OCR1.TIF"
   ' Load the image
   Dim srcImage As RasterImage = 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)
   Dim smallImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "quality.ecw")

   ' Clean up
   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

System.Object
   Leadtools.Codecs.CodecsEcwOptions

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also