[AsyncStateMachineAttribute(System.Type)]
public static Task<ILeadStream> FromUri(
Uri uri
)
<AsyncStateMachineAttribute(System.Type)>
Public Shared Function FromUri(
ByVal uri As Uri
) As Task(Of ILeadStream)
uri
.NET Uri
containing the path to the remote resource. This value will be set into the HttpClientLeadStream.Uri property.
ILeadStream object. This method returns an instance of HttpClientLeadStream.
This method will create a new instance of HttpClientLeadStream with Uri set to uri. This object can then be passed to the various LEADTOOLS class members that accept an ILeadStream object. Such as RasterCodecs.GetInformationAsync, RasterCodecs.LoadAsync, RasterCodecs.LoadSvgAsync or RasterCodecs.SaveAsync.
The method will create a new instance of LeadFileStream using:
var httpClientLeadStream = new HttpClientLeadStream(uri);
await httpClientLeadStream.Open();
return httpClientLeadStream;
Note that for performance reasons, this method will check if uri contains the path to a physical file on disk. In this case, the toolkit will use LeadStream.Factory.OpenFile to create and return a LeadFileStream object instead:
if (IsFileUri(uri))
return LeadStream.Factory.OpenFile(GetPhysicalPath(uri));
// Continue as above
Refer to RasterCodecs Async Operations for more information and examples.
For .NET Framework: A reference to the Leadtools.Async.dll assembly is required to use this functionality.
For .NET Standard: This functionality is included in the Leadtools.dll assembly.
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