←Select platform

OriginalFormat Property

Summary
Gets or sets the original image format of this RasterImage.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public RasterImageFormat OriginalFormat { get; set; } 
@property (nonatomic, assign) LTRasterImageFormat originalFormat 
public RasterImageFormat getOriginalFormat(); 
public void setOriginalFormat( 
   RasterImageFormat rasterImageFormat 
); 
public: 
property RasterImageFormat OriginalFormat { 
   RasterImageFormat get(); 
   void set (    RasterImageFormat ); 
} 
OriginalFormat # get and set (RasterImage) 

Property Value

The original image format of this RasterImage.

Remarks

When a RasterImage object is created by loading it from an image file, this property will hold the format type of the file as a RasterImageFormat enumeration member.

If the RasterImage was created by other means (for example, through the RasterImage constructor or scanning), the value of this property will be RasterImageFormat.Unknown.

Example

This example displays the OriginalFormat of the loaded image.

C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Core; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Dicom; 
using Leadtools.Drawing; 
using Leadtools.Controls; 
using Leadtools.Svg; 
 
 
public void OriginalFormatExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "OCR1.TIF")); 
 
   string s = ("Original Format: " + image.OriginalFormat); 
   Console.WriteLine(s); 
 
   image.Dispose(); 
   codecs.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.File; 
import java.io.FileInputStream; 
import java.io.IOException; 
import java.io.InputStream; 
import java.util.ArrayList; 
import java.util.List; 
 
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.imageprocessing.core.*; 
import leadtools.svg.*; 
import leadtools.imageprocessing.CloneCommand; 
import leadtools.imageprocessing.FillCommand; 
import leadtools.imageprocessing.FlipCommand; 
import leadtools.imageprocessing.GrayscaleCommand; 
import leadtools.imageprocessing.color.InvertCommand; 
import leadtools.imageprocessing.color.PosterizeCommand; 
 
 
public void originalFormatExample() { 
 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
   RasterCodecs codecs = new RasterCodecs(); 
   RasterImage image = codecs.load(combine(LEAD_VARS_IMAGES_DIR, "testframe1.jpg")); 
 
   // Get the original format 
   String s = ("Original Format: " + image.getOriginalFormat()); 
   System.out.println(s); 
 
   assertTrue("Original format is not TIF", image.getOriginalFormat() == RasterImageFormat.JPEG_411); 
 
   // Clean up 
   image.dispose(); 
   codecs.dispose(); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.