Examines a file to determine which resolutions it contains.
public [Leadtools.LeadSize[]](../l/leadsize.html) ReadLoadResolutions(string fileName)
Public Overloads Function ReadLoadResolutions( _ByVal fileName As String _) As Leadtools.LeadSize()
public [Leadtools.LeadSize[]](../l/leadsize.html) ReadLoadResolutions(string fileName)
- (nullable NSArray<NSValue/*CGSize*/ *> *)loadResolutionsForFile:(NSString *)file error:(NSError **)error function Leadtools.Codecs.RasterCodecs.ReadLoadResolutions(String)(fileName)
public:Leadtools.array<LeadSize>^ ReadLoadResolutions(String^ fileName)
fileName
A String containing the name of the file to query.
A LeadSize structure containing the available resolutions.
A FlashPix, PhotoCD, ECW, JPEG 2000 or JBIG/JBIG2 file can contain more than one copy of the same image, each at a different physical resolution (width and height in pixels).
After you get the available resolutions, you can use any of the following to specify the one to be loaded:
For more information, refer to Implementing JBIG Features.
This example shows how many physical resolutions are available, selects the smallest one, then loads the file.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Svg;using LeadtoolsExamples.Common;void ReadLoadResolutionsExample(string jbigFileName){RasterCodecs codecs = new RasterCodecs();// Get the number of resolutions (sizes) available in this fileLeadSize[] resolution = codecs.ReadLoadResolutions(jbigFileName);if (resolution.Length > 0){Console.WriteLine("{0} resolutions available", resolution.Length);for (int i = 0; i < resolution.Length; i++)Console.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 sizeCodecsImageInfo info = codecs.GetInformation(jbigFileName, false);Console.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 fileRasterImage image = codecs.Load(jbigFileName);Console.WriteLine("Size of image loaded is {0} by {1}", image.Width, image.Height);image.Dispose();}elseConsole.WriteLine("No resolutions found");// Clean upcodecs.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingImports Leadtools.SvgPrivate Sub ReadLoadResolutionsExample(ByVal jbigFileName As String)Dim codecs As RasterCodecs = New RasterCodecs()' Get the number of resolutions (sizes) available in this fileDim resolution As LeadSize() = codecs.ReadLoadResolutions(jbigFileName)If resolution.Length > 0 ThenConsole.WriteLine("{0} resolutions available", resolution.Length)Dim i As Integer = 0Do While i < resolution.LengthConsole.WriteLine("{0} by {1}", resolution(i).Width, resolution(i).Height)i += 1Loop' Set the size to load, the smallest size in this case */codecs.Options.Jpeg2000.Load.J2kResolution = resolution(0)' Get the info about the image to show its original sizeDim info As CodecsImageInfo = codecs.GetInformation(jbigFileName, False)Console.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 fileDim image As RasterImage = codecs.Load(jbigFileName)Console.WriteLine("Size of image loaded is {0} by {1}", image.Width, image.Height)image.Dispose()ElseConsole.WriteLine("No resolutions found")End If' Clean upcodecs.Dispose()End Sub
using Leadtools;using Leadtools.Codecs;using Leadtools.Examples;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Windows.Media;public void ReadLoadResolutionsExample(Stream inStreamJbig){RasterCodecs codecs = new RasterCodecs();// Get the number of resolutions (sizes) available in this fileLeadSize[] resolution = codecs.ReadLoadResolutions(inStreamJbig);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 sizeCodecsImageInfo info = codecs.GetInformation(inStreamJbig, 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 fileRasterImage image = codecs.Load(inStreamJbig);Debug.WriteLine("Size of image loaded is {0} by {1}", image.Width, image.Height);image.Dispose();}elseDebug.WriteLine("No resolutions found");}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.Windows.MediaPublic Sub ReadLoadResolutionsExample(ByVal inStreamJbig As Stream)Dim codecs As RasterCodecs = New RasterCodecs()' Get the number of resolutions (sizes) available in this fileDim resolution As LeadSize() = codecs.ReadLoadResolutions(inStreamJbig)If resolution.Length > 0 ThenDebug.WriteLine("{0} resolutions available", resolution.Length)Dim i As Integer = 0Do While i < resolution.LengthDebug.WriteLine("{0} by {1}", resolution(i).Width, resolution(i).Height)i += 1Loop' 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 sizeDim info As CodecsImageInfo = codecs.GetInformation(inStreamJbig, 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 fileDim image As RasterImage = codecs.Load(inStreamJbig)Debug.WriteLine("Size of image loaded is {0} by {1}", image.Width, image.Height)image.Dispose()ElseDebug.WriteLine("No resolutions found")End IfEnd Sub
|
Products |
Support |
Feedback: ReadLoadResolutions(String) Method - Leadtools.Codecs |
Introduction |
Help Version 19.0.2017.6.16
|

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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.