Gets the image information from a stream.
public Leadtools.Codecs.CodecsImageInfo GetInformation(Stream stream,bool totalPages)
Public Overloads Function GetInformation( _ByVal stream As Stream, _ByVal totalPages As Boolean _) As Leadtools.Codecs.CodecsImageInfo
public Leadtools.Codecs.CodecsImageInfo GetInformation(Stream stream,bool totalPages)
- (nullable LTCodecsImageInfo *)imageInformationForStream:(LTLeadStream *)streamtotalPages:(BOOL)totalPageserror:(NSError **)error
public CodecsImageInfo getInformation(ILeadStream stream, boolean totalPages) function Leadtools.Codecs.RasterCodecs.GetInformation(Stream,Boolean)(stream ,totalPages)
public:Leadtools.Codecs.CodecsImageInfo^ GetInformation(Stream^ stream,bool totalPages)
stream
Stream containing the input image data.
totalPages
true to query the file for total number of pages; false, otherwise.
A CodecsImageInfo object that contains the information about the specified image.
Specifying true for totalPages can cause the process to be slow for files with large number of pages.
To quickly query the number of an image, use GetTotalPages or GetTotalPagesAsync.
To quickly query the format of an image, use GetFormat or GetFormatAsync.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Svg;using LeadtoolsExamples.Common;public void GetInformationStreamExample(){RasterCodecs codecs = new RasterCodecs();// Get Information on a GIF image file and write it outstring srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "eye.gif");FileStream fileInMemory = new FileStream(srcFileName, FileMode.Open);CodecsImageInfo info = codecs.GetInformation(fileInMemory, true);Console.WriteLine("Information for: {0}", srcFileName);Console.WriteLine(string.Format("BitsPerPixel: {0}", info.BitsPerPixel));Console.WriteLine(string.Format("BytesPerLine: {0}", info.BytesPerLine));Console.WriteLine(string.Format("ColorSpace: {0}", info.ColorSpace.ToString()));Console.WriteLine(string.Format("Compresion: {0}", info.Compression));Console.WriteLine(string.Format("Fax: {0}", info.Fax));Console.WriteLine(string.Format("Format: {0}", info.Format));if (info.Gif.HasAnimationBackground)Console.WriteLine(string.Format("Gif.AnimationBackground: {0}", info.Gif.AnimationBackground.ToString()));Console.WriteLine(string.Format("Gif.AnimationHeight: {0}", info.Gif.AnimationHeight));Console.WriteLine(string.Format("Gif.AnimationWidth: {0}", info.Gif.AnimationWidth));if (info.Gif.HasAnimationLoop)Console.WriteLine(string.Format("Gif.AnimationLoop: {0}", info.Gif.AnimationLoop.ToString()));if (info.Gif.HasAnimationPalette){RasterColor[] pal = info.Gif.GetAnimationPalette();Console.WriteLine("GifAnimationPalette:\n");for (int x = 0; x < pal.Length; x++){Console.Write("{0},", pal[x]);}Console.WriteLine("\n");}Console.WriteLine(string.Format("Gif.IsInterlaced: {0}", info.Gif.IsInterlaced.ToString()));Console.WriteLine(string.Format("PageNumber: {0}", info.PageNumber));Console.WriteLine(string.Format("TotalPages: {0}", info.TotalPages));// Clean upcodecs.Dispose();fileInMemory.Close();fileInMemory.Dispose();}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingImports Leadtools.SvgPublic Sub GetInformationStreamExample()Dim codecs As RasterCodecs = New RasterCodecs()' Get Information on a GIF image file and write it outDim srcFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "eye.gif")Dim fileInMemory As FileStream = New FileStream(srcFileName, FileMode.Open)Dim info As CodecsImageInfo = codecs.GetInformation(fileInMemory, True)Console.WriteLine("Information for: {0}", srcFileName)Console.WriteLine(String.Format("BitsPerPixel: {0}", info.BitsPerPixel))Console.WriteLine(String.Format("BytesPerLine: {0}", info.BytesPerLine))Console.WriteLine(String.Format("ColorSpace: {0}", info.ColorSpace.ToString()))Console.WriteLine(String.Format("Compresion: {0}", info.Compression))Console.WriteLine(String.Format("Fax: {0}", info.Fax))Console.WriteLine(String.Format("Format: {0}", info.Format))If info.Gif.HasAnimationBackground ThenConsole.WriteLine(String.Format("Gif.AnimationBackground: {0}", info.Gif.AnimationBackground.ToString()))End IfConsole.WriteLine(String.Format("Gif.AnimationHeight: {0}", info.Gif.AnimationHeight))Console.WriteLine(String.Format("Gif.AnimationWidth: {0}", info.Gif.AnimationWidth))If info.Gif.HasAnimationLoop ThenConsole.WriteLine(String.Format("Gif.AnimationLoop: {0}", info.Gif.AnimationLoop.ToString()))End IfIf info.Gif.HasAnimationPalette ThenDim pal As RasterColor() = info.Gif.GetAnimationPalette()Console.WriteLine("GifAnimationPalette:" & Constants.vbLf)Dim x As Integer = 0Do While x < pal.LengthConsole.Write("{0},", pal(x))x += 1LoopConsole.WriteLine(Constants.vbLf)End IfConsole.WriteLine(String.Format("Gif.IsInterlaced: {0}", info.Gif.IsInterlaced.ToString()))Console.WriteLine(String.Format("PageNumber: {0}", info.PageNumber))Console.WriteLine(String.Format("TotalPages: {0}", info.TotalPages))' Clean upcodecs.Dispose()fileInMemory.Close()fileInMemory.Dispose()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
using Leadtools;using Leadtools.Codecs;using Leadtools.Examples;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Windows.Media;public void GetInformationStreamExample(Stream inStreamGif){RasterCodecs codecs = new RasterCodecs();// Get Information on a GIF image file and write it outCodecsImageInfo info = codecs.GetInformation(inStreamGif, true);Debug.WriteLine(string.Format("BitsPerPixel: {0}", info.BitsPerPixel));Debug.WriteLine(string.Format("BytesPerLine: {0}", info.BytesPerLine));Debug.WriteLine(string.Format("ColorSpace: {0}", info.ColorSpace.ToString()));Debug.WriteLine(string.Format("Compresion: {0}", info.Compression));Debug.WriteLine(string.Format("Fax: {0}", info.Fax));Debug.WriteLine(string.Format("Format: {0}", info.Format));if (info.Gif.HasAnimationBackground)Debug.WriteLine(string.Format("Gif.AnimationBackground: {0}", info.Gif.AnimationBackground.ToString()));Debug.WriteLine(string.Format("Gif.AnimationHeight: {0}", info.Gif.AnimationHeight));Debug.WriteLine(string.Format("Gif.AnimationWidth: {0}", info.Gif.AnimationWidth));if (info.Gif.HasAnimationLoop)Debug.WriteLine(string.Format("Gif.AnimationLoop: {0}", info.Gif.AnimationLoop.ToString()));if (info.Gif.HasAnimationPalette){RasterColor[] pal = info.Gif.GetAnimationPalette();Debug.WriteLine("GifAnimationPalette:\n");for (int x = 0; x < pal.Length; x++){Debug.WriteLine("{0},", pal[x]);}Debug.WriteLine("\n");}Debug.WriteLine(string.Format("Gif.IsInterlaced: {0}", info.Gif.IsInterlaced.ToString()));Debug.WriteLine(string.Format("PageNumber: {0}", info.PageNumber));Debug.WriteLine(string.Format("TotalPages: {0}", info.TotalPages));// Clean upinStreamGif.Close();inStreamGif.Dispose();}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.Windows.MediaPublic Sub GetInformationStreamExample(ByVal inStreamGif As Stream)Dim codecs As RasterCodecs = New RasterCodecs()' Get Information on a GIF image file and write it outDim info As CodecsImageInfo = codecs.GetInformation(inStreamGif, True)Debug.WriteLine(String.Format("BitsPerPixel: {0}", info.BitsPerPixel))Debug.WriteLine(String.Format("BytesPerLine: {0}", info.BytesPerLine))Debug.WriteLine(String.Format("ColorSpace: {0}", info.ColorSpace.ToString()))Debug.WriteLine(String.Format("Compresion: {0}", info.Compression))Debug.WriteLine(String.Format("Fax: {0}", info.Fax))Debug.WriteLine(String.Format("Format: {0}", info.Format))If info.Gif.HasAnimationBackground ThenDebug.WriteLine(String.Format("Gif.AnimationBackground: {0}", info.Gif.AnimationBackground.ToString()))End IfDebug.WriteLine(String.Format("Gif.AnimationHeight: {0}", info.Gif.AnimationHeight))Debug.WriteLine(String.Format("Gif.AnimationWidth: {0}", info.Gif.AnimationWidth))If info.Gif.HasAnimationLoop ThenDebug.WriteLine(String.Format("Gif.AnimationLoop: {0}", info.Gif.AnimationLoop.ToString()))End IfIf info.Gif.HasAnimationPalette ThenDim pal As RasterColor() = info.Gif.GetAnimationPalette()Debug.WriteLine("GifAnimationPalette:" & Constants.vbLf)Dim x As Integer = 0Do While x < pal.LengthDebug.WriteLine("{0},", pal(x))x += 1LoopDebug.WriteLine(Constants.vbLf)End IfDebug.WriteLine(String.Format("Gif.IsInterlaced: {0}", info.Gif.IsInterlaced.ToString()))Debug.WriteLine(String.Format("PageNumber: {0}", info.PageNumber))Debug.WriteLine(String.Format("TotalPages: {0}", info.TotalPages))' Clean upinStreamGif.Close()inStreamGif.Dispose()End Sub
|
Products |
Support |
Feedback: GetInformation(Stream,Boolean) 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.