←Select platform

J2kResolution Property

Summary
Gets or sets the resolution to load when loading J2K streams.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public LeadSize J2kResolution { get; set; } 
@property (nonatomic, assign) LeadSize j2kResolution; 
public LeadSize getJ2kResolution() 
public void setJ2kResolution(LeadSize value) 
public: 
property LeadSize J2kResolution { 
   LeadSize get(); 
   void set (    LeadSize ); 
} 
J2kResolution # get and set (CodecsTiffLoadOptions) 

Property Value

The resolution to load. The default value is 0,0.

Remarks

Specifies the resolution of the image to load. You can specify 0 to get the default.

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
void ReadLoadResolutionsExample(string jbigFileName) 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   // Get the number of resolutions (sizes) available in this file 
   LeadSize[] resolution = codecs.ReadLoadResolutions(jbigFileName); 
   if (resolution.Length > 0) 
   { 
      Debug.WriteLine("{0} resolutions available", resolution.Length); 
      for (int i = 0; i < resolution.Length; i++) 
         Debug.WriteLine("{0} by {1}", resolution[i].Width, resolution[i].Height); 
 
      // Set the size to load, the smallest size in this case */ 
      codecs.Options.Jpeg2000.Load.J2kResolution = resolution[0]; 
 
      // Get the info in of the image to show its original size 
      CodecsImageInfo info = codecs.GetInformation(jbigFileName, false); 
      Debug.WriteLine("Size of image according to GetInformation is {0} by {1}", info.Width, info.Height); 
 
      // Load the image, keeping the bits per pixel of the file 
      RasterImage image = codecs.Load(jbigFileName); 
      Debug.WriteLine("Size of image loaded is {0} by {1}", image.Width, image.Height); 
 
      image.Dispose(); 
   } 
   else 
      Debug.WriteLine("No resolutions found"); 
 
   // Clean up 
   codecs.Dispose(); 
} 
 
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 readLoadResolutionsExample() throws IOException { 
   RasterCodecs codecs = new RasterCodecs(); 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
   String jbigFileName = combine(LEAD_VARS_IMAGES_DIR, "jbig.jbg"); 
 
   // Get the number of resolutions (sizes) available in this file 
   ILeadStream ls = LeadStreamFactory.create(jbigFileName); 
   LeadSize[] resolution = codecs.readLoadResolutions(ls); 
 
   if (resolution.length > 0) { 
      System.out.println(resolution.length + " resolutions available"); 
      for (int i = 0; i < resolution.length; i++) 
         System.out.println(resolution[i].getWidth() + " by " + resolution[i].getHeight()); 
 
      // Set the size to load, the smallest size in this case // 
      codecs.getOptions().getJpeg2000().getLoad().setJ2kResolution(resolution[0]); 
 
      // Get the info in of the image to show its original size 
      CodecsImageInfo info = codecs.getInformation(ls, false); 
      System.out.println( 
            "Size of image according to GetInformation is " + info.getWidth() + " by " + info.getHeight()); 
 
      // Load the image, keeping the bits per pixel of the file 
      RasterImage image = codecs.load(ls); 
      System.out.println( 
            "Size of image loaded is " + image.getWidth() + " by " + image.getHeight()); 
 
      image.dispose(); 
   } else { 
      System.out.println("No resolutions found"); 
   } 
 
   // Clean up 
   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.Codecs Assembly

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