- (LTCodecsFeedGetInformationStatus)feedGetInformation:(const unsigned char *)buffer length:(NSUInteger)length error:(NSError **)error
- (LTCodecsFeedGetInformationStatus)feedGetInformationData:(NSData*)data length:(NSUInteger)length error:(NSError**)error
data
The image file unmanaged memory data.
length
Total size (in bytes) of the image data.
true if the get information process requires more data; false, otherwise. When this method returns false, you can break out of the loop and call StopFeedGetInformation to obtain the CodecsImageInfo object containing information about the image file.
Use this method with the StartFeedGetInformation and StopFeedGetInformation methods.
For a description of how the methods relate to each other, refer to StartFeedGetInformation.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
using Leadtools.Svg;
public void FeedGetInformationExample()
{
RasterCodecs codecs = new RasterCodecs();
codecs.CancelFeedGetInformation();
string url = @"https://www.leadtools.com/images/page_graphics/leadlogo.png";
// Create a WebRequest for the URL
WebRequest request = WebRequest.Create(url);
request.Proxy.Credentials = CredentialCache.DefaultCredentials;
// reduce the timeout to 20 sec
request.Timeout = 20000;
WebResponse response = request.GetResponse();
try
{
Stream strm = response.GetResponseStream();
// Read chunks from the stream and feed load to the image
codecs.StartFeedGetInformation(true, 1);
const int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
bool more;
do
{
System.Windows.Forms.Application.DoEvents();
int read = strm.Read(buffer, 0, bufferSize);
Debug.WriteLine("Downloading {0} bytes", read);
if (read > 0)
more = codecs.FeedGetInformation(buffer, 0, read);
else
{
// no more image data in the stream
more = false;
}
}
while (more);
}
finally
{
response.Close();
}
CodecsImageInfo info = codecs.StopFeedGetInformation();
// Clean up
codecs.Dispose();
// Show the information
Debug.WriteLine(info.ToString());
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document