←Select platform

Open Method

Summary

Opens a stream to the URI used by this HttpClientLeadStream.

Syntax
C#
Python
[AsyncStateMachineAttribute(System.Type)] 
public Task<bool> Open() 
def Open(self):  

Return Value

true if successful; otherwise, false.

Remarks

The LEADTOOLS class methods that uses LeadStream such as RasterCodecs.GetInformationAsync, RasterCodecs.LoadAsync, RasterCodecs.LoadSvgAsync or RasterCodecs.SaveAsync will call Open when it is ready to use the underlying stream.

Open will perform the following:

  1. Returns immediately if the value of IsOpen is true. This means the stream is already opened.
  2. Uses the HttpClient object created internally automatically by this class to.
  3. Create a new .NET System.IO.Stream using the following and setting it into the Stream property:

    C#
    this.Stream = await this.HttpClient.GetStreamAsync(this.Uri); 
  4. Sets the value of IsOpen to true.

Afterwards, the LEADTOOLS methods will access Stream to load or store data.

Refer to RasterCodecs Async Operations for more information and examples.

Requirements

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.

Target Platforms

Help Version 23.0.2024.5.22
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.