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



Provides support for loading and saving raster image files.

Object Model


Syntax

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

Example

This example loads an existing image file and re-saves it in another format.

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

   Dim srcFileName As String = LeadtoolsExamples.Common.ImagesPath.Path + "Image1.cmp"
   Dim dstFileName As String = LeadtoolsExamples.Common.ImagesPath.Path + "Image1_test.jpg"

   Dim image As RasterImage = codecs.Load(srcFileName)
   codecs.Save(image, dstFileName, RasterImageFormat.Jpeg, 0)

   ' Clean up
   image.Dispose()
   codecs.Dispose()
   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void RasterCodecsExample() 

   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
 
   string srcFileName = LeadtoolsExamples.Common.ImagesPath.Path + "Image1.cmp"; 
   string dstFileName = LeadtoolsExamples.Common.ImagesPath.Path + "Image1_test.jpg"; 
 
   RasterImage image = codecs.Load(srcFileName); 
   codecs.Save(image, dstFileName, RasterImageFormat.Jpeg, 0); 
 
   // Clean up 
   image.Dispose(); 
   codecs.Dispose(); 
   RasterCodecs.Shutdown(); 
}

Remarks

LEADTOOLS provides many options for loading and saving image files.

Whether an image file is on disk or in memory, you can get information about the image before loading it. You can also handle file-format-specific information, such as the page number or physical resolution.

You can supply the input for a load operation or the output of a save operation, and you can add processing, such as a paint-while-load feature.

Inheritance Hierarchy

System.Object
   Leadtools.Codecs.RasterCodecs

Requirements

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

See Also