Examines a PhotoCD file to determine which resolutions it contains.
public int[] GetPcdResolution(string fileName)
Public Function GetPcdResolution( _ByVal fileName As String _) As Integer()
public:array<int>^ GetPcdResolution(String^ fileName)
fileName
A String containing the name of the PhotoCD file.
An array of 6 boolean values that specifies if the resolution at the corresponding index exists.
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 |
This example checks for a high resolution PCD image and loads it if possible.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Svg;using LeadtoolsExamples.Common;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 possibleif (resolutions[pcd4Base] != 0){codecs.Options.Pcd.Load.Resolution = new LeadSize(1024, 1536);Console.WriteLine("Loading Loading 1024 x 1536");}else{codecs.Options.Pcd.Load.Resolution = new LeadSize(512, 768);Console.WriteLine("Loading 512 x 768");}// Load the image at its own bits per pixelRasterImage image = codecs.Load(pcdFileName, 0, CodecsLoadByteOrder.Bgr, 1, 1);Console.WriteLine("Image size loaded: {0} by {1}", image.Width, image.Height);image.Dispose();// Reset the default PCD resolutioncodecs.Options.Pcd.Load.Resolution = new LeadSize(512, 768);// Clean upcodecs.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingImports Leadtools.SvgPrivate Sub GetPcdResolutionExample(ByVal pcdFileName As String)Dim codecs As RasterCodecs = New RasterCodecs()' Get the PCD resolution information.Const pcd4Base As Integer = 4Dim resolutions As Integer() = codecs.GetPcdResolution(pcdFileName)' Use high resolution if possibleIf resolutions(pcd4Base) <> 0 Thencodecs.Options.Pcd.Load.Resolution = New LeadSize(1024, 1536)Console.WriteLine("Loading Loading 1024 x 1536")Elsecodecs.Options.Pcd.Load.Resolution = New LeadSize(512, 768)Console.WriteLine("Loading 512 x 768")End If' Load the image at its own bits per pixelDim image As RasterImage = codecs.Load(pcdFileName, 0, CodecsLoadByteOrder.Bgr, 1, 1)Console.WriteLine("Image size loaded: {0} by {1}", image.Width, image.Height)image.Dispose()' Reset the default PCD resolutioncodecs.Options.Pcd.Load.Resolution = New LeadSize(512, 768)' Clean upcodecs.Dispose()End Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
