public CodecsImageInfo StopFeedGetInformation() - (nullable LTCodecsImageInfo *)stopFeedGetInformation:(NSError **)error public CodecsImageInfo stopFeedGetInformation() public:CodecsImageInfo^ StopFeedGetInformation();
def StopFeedGetInformation(self):
An CodecsImageInfo object containing information about the image data provided by FeedGetInformation.
This cleans up all the variables and buffers allocated by the StartFeedGetInformation and FeedGetInformation methods and resets all internal variables to their default settings.
You must call this method to complete the file information that was started with StartFeedGetInformation.
If you call this method before enough data is supplied to obtain the image information, it will successfully clean up the process, but will throw an exception. You should trap the error if the process is canceled purposely.
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 URLWebRequest request = WebRequest.Create(url);request.Proxy.Credentials = CredentialCache.DefaultCredentials;// reduce the timeout to 20 secrequest.Timeout = 20000;WebResponse response = request.GetResponse();try{Stream strm = response.GetResponseStream();// Read chunks from the stream and feed load to the imagecodecs.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 streammore = false;}}while (more);}finally{response.Close();}CodecsImageInfo info = codecs.StopFeedGetInformation();// Clean upcodecs.Dispose();// Show the informationDebug.WriteLine(info.ToString());}
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.*;public void feedGetInformationExample() throws IOException {RasterCodecs codecs = new RasterCodecs();URL url = new URL("https://www.leadtools.com/images/page_graphics/leadlogo.png");// Create a WebRequest for the URLHttpURLConnection con = (HttpURLConnection) url.openConnection();con.setRequestMethod("GET");con.setDefaultUseCaches(true);// reduce the timeout to 20seccon.setConnectTimeout(20000);con.setReadTimeout(20000);con.getResponseCode();FeedCallbackThunk feedLoad;try {InputStream inputStream = con.getInputStream();// Read chunks from the stream and feed load to the imagefeedLoad = codecs.startFeedGetInformation(true, 1);final int bufferSize = 1024;byte[] buffer = new byte[bufferSize];boolean more;do {int read = inputStream.read(buffer, 0, bufferSize);System.out.println("Downloading " + read + " bytes");if (read > 0)more = feedLoad.feedGetInformation(buffer, 0, read);else {// no more image data in the streammore = false;}} while (more);} finally {con.disconnect();}CodecsImageInfo info = feedLoad.stopFeedGetInformation();// Clean upcodecs.dispose();// Show the informationassertTrue("The URL is invalid (null)", url != null);System.out.println(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
