←Select platform

GetPcdResolution Method

Summary
Examines a PhotoCD file to determine which resolutions it contains.
Syntax
C#
C++/CLI
Python
public int[] GetPcdResolution( 
   string fileName 
) 
public: 
array<int>^ GetPcdResolution(  
   String^ fileName 
)  
def GetPcdResolution(self,fileName): 

Parameters

fileName
A String containing the name of the PhotoCD file.

Return Value

An array of 6 boolean values that specifies if the resolution at the corresponding index exists.

Remarks

For the returned array of booleans, true means the corresponding resolution at this index exist in the file, while false means the corresponding resolution at the index does not exist in the file.

The following table defines the resolution value at each index:

Index Meaning
0 (PCD Base Over 64) Resolution 64 x 96
1 (PCD Base Over 16) Resolution 128 x 192
2 (PCD Base Over 4) Resolution 256 x 384
3 (PCD Base) Resolution 512 x 768
4 (PCD 4 Base) Resolution 1024 x 1536
5 (PCD 16 Base) Resolution 2048 x 3072
Example

This example checks for a high resolution PCD image and loads it if possible.

C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
void GetPcdResolutionExample(string pcdFileName) 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   // Get the PCD resolution information. 
   const int pcd4Base = 4; 
 
   int[] resolutions = codecs.GetPcdResolution(pcdFileName); 
 
   // Use high resolution if possible 
   if (resolutions[pcd4Base] != 0) 
   { 
      codecs.Options.Pcd.Load.Resolution = new LeadSize(1024, 1536); 
      Debug.WriteLine("Loading 1024 x 1536"); 
   } 
   else 
   { 
      codecs.Options.Pcd.Load.Resolution = new LeadSize(512, 768); 
      Debug.WriteLine("Loading 512 x 768"); 
   } 
 
   // Load the image at its own bits per pixel 
   RasterImage image = codecs.Load(pcdFileName, 0, CodecsLoadByteOrder.Bgr, 1, 1); 
   Debug.WriteLine("Image size loaded: {0} by {1}", image.Width, image.Height); 
   image.Dispose(); 
 
   // Reset the default PCD resolution 
   codecs.Options.Pcd.Load.Resolution = new LeadSize(512, 768); 
 
   // 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.*; 
 
 
// void GetPcdResolutionExample(String pcdFileName) { 
// RasterCodecs codecs = new RasterCodecs(); 
 
// // Get the PCD resolution information. 
// final int pcd4Base = 4; 
// int[] resolutions = codecs.getPcdResolution(pcdFileName); 
 
// // Use high resolution if possible 
// if (resolutions[pcd4Base] != 0) { 
// codecs.getOptions().getPcd().getLoad().setResolution(new LeadSize(1024, 
// 1536)); 
// System.out.println("Loading 1024 x 1536"); 
// } else { 
// codecs.getOptions().getPcd().getLoad().setResolution(new LeadSize(512, 768)); 
// System.out.println("Loading 512 x 768"); 
// } 
 
// // Load the image at its own bits per pixel 
// RasterImage image = codecs.load(pcdFileName, 0, CodecsLoadByteOrder.BGR, 1, 
// 1); 
// System.out.println(String.format("Image size loaded: %s by %s", 
// image.getWidth(), image.getHeight())); 
// image.dispose(); 
 
// // Reset the default PCD resolution 
// codecs.getOptions().getPcd().getLoad().setResolution(new LeadSize(512, 768)); 
 
// // 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.