←Select platform

Options Property

Summary

Gets or sets the load and save options for this RasterCodecs.

Syntax

C#
Objective-C
C++/CLI
Java
Python
public CodecsOptions Options { get; set; } 
@property (nonatomic, strong) LTCodecsOptions *options; 
public CodecsOptions getOptions() 
public void setOptions(CodecsOptions value) 
public: 
property CodecsOptions^ Options { 
   CodecsOptions^ get(); 
   void set (    CodecsOptions^ ); 
} 
Options # get and set (RasterCodecs) 

Property Value

The load and save options for this RasterCodecs.

Remarks

The RasterCodecs class lets you set different options when loading and saving image files. These options are categorized into groups corresponding to the image format they are applied to. Some of the options are "global", for example, overriding the resolution of the file to load. You manipulate the options of a certain format through the embedded classes inside the Options property of this RasterCodecs object. For example, to disable MMX when loading JPEG options, you would do:

rasterCodecsObject.Options.Jpeg.Load.DisableMmx = true;

Alternatively, you can obtain an instance of the correct options, manipulate the values before setting it back as follows:

CodecsOptions options = rasterCodecsObject.Options; 
options.Jpeg.Load.DisableMmx = true; 
rasterCodecsObject.Options = options; 

You can access the various options with the following properties:

Class Description
CodecsLoadOptions Global load options. Accessed through the CodecsOptions.Load property.
CodecsSaveOptions Global save options. Accessed through the CodecsOptions.Save property.
CodecsEpsOptions EPS format options. Accessed through the CodecsOptions.Eps property.
CodecsExcelOptions Excel (XLS, XLSX) format options. Accessed through the CodecsOptions.Excel property.
CodecsFpxOptions FPX (FlashPix) format options. Accessed through the CodecsOptions.Fpx property.
CodecsGifOptions GIF format options. Accessed through the CodecsOptions.Gif property.
CodecsJbigOptions JBIG format options. Accessed through the CodecsOptions.Jbig property.
CodecsJbig2Options JBIG2 format options. Accessed through the CodecsOptions.Jbig2 property.
CodecsJpegOptions JPEG and LEAD CMP Compressed format options. Accessed through the CodecsOptions.Jpeg property.
CodecsJpeg2000Options JPEG 2000 and LEAD CMW Compressed format options. Accessed through the CodecsOptions.Jpeg2000 property.
CodecsPcdOptions PCD format options. Accessed through the CodecsOptions.Pcd property.
CodecsPdfOptions PDF format options. Accessed through the CodecsOptions.Pdf property.
CodecsPngOptions PNG format options. Accessed through the CodecsOptions.Png property.
CodecsPowerPointOptions PowerPoint (PPT, PPTX) format options. Accessed through the CodecsOptions.PowerPoint property.
CodecsPstOptions Outlook PST, MSG and EML format options. Accessed through the CodecsOptions.Pst property.
CodecsPtokaOptions PTOKA format options. Accessed through the CodecsOptions.Ptoka property.
CodecsRawOptions RAW format options. Accessed through the CodecsOptions.Raw property.
CodecsRtfOptions RTF format options. Accessed through the CodecsOptions.Rtf property.
CodecsTiffOptions TIFF format options. Accessed through the CodecsOptions.Tiff property.
CodecsTxtOptions TEXT format options. Accessed through the CodecsOptions.Txt property.
CodecsWmfOptions WMF format options. Accessed through the CodecsOptions.Wmf property.
CodecsXpsOptions XPS format options. Accessed through the CodecsOptions.Xps property.

The RasterCodecs.SaveOptions and RasterCodecs.LoadOptions methods can be used to save or load the current options to a disk file ot a stream.

Example

C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
public void RasterCodecsExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   Console.WriteLine(codecs.Options); 
 
   string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"); 
   string dstFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1_test.jpg"); 
 
   RasterImage image = codecs.Load(srcFileName); 
   codecs.Save(image, dstFileName, RasterImageFormat.Jpeg, 0); 
 
   // Finalize cannot be called directly, it is invoked automatically. 
   // To clean up before exiting, use Dispose 
   image.Dispose(); 
   codecs.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
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 rasterCodecsExample() { 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
   RasterCodecs codecs = new RasterCodecs(); 
 
   System.out.println(codecs.getOptions()); 
 
   String srcFileName = combine(LEAD_VARS_IMAGES_DIR, "Image1.cmp"); 
   String dstFileName = combine(LEAD_VARS_IMAGES_DIR, "Image1_test.jpg"); 
 
   RasterImage image = codecs.load(srcFileName); 
   codecs.save(image, dstFileName, RasterImageFormat.JPEG, 0); 
 
   assertTrue("File unsuccessfully saved", (new File(dstFileName)).exists()); 
   System.out.println("File successfully saved to " + dstFileName); 
 
   // Finalize cannot be called directly, it is invoked automatically. 
   // To clean up before exiting, use Dispose 
   image.dispose(); 
   codecs.dispose(); 
} 

Requirements

Target Platforms

See Also

Reference

RasterCodecs Class

RasterCodecs Members

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.