×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    2

    Unable to use downloaded image stream

    Nokia just released 'Nokia Imaging SDK' version 1, however now I can not use a Stream download image since SDK' StreamImageSource tries to use Stream.Length which is unavailable for Async Stream. Any suggestions of how can I get around this issue?

    here is my code

    Code:
    HttpClient c = new HttpClient();
    Stream orgImageStream = await c.GetStreamAsync(imageUri);
    var imageSource = new StreamImageSource(orgImageStream);  //fails here since he tries to use Stream.Length

    Thanks,

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    429

    Re: Unable to use downloaded image stream

    It's not an issue of the stream being created async (as it's awaited anyway) but rather of the type of stream not providing that property. You could create a MemoryStream, copy all the information in the ImageStream to the MemoryStream and load the data from the MemoryStream into the Imaging SDK (don't forget to call stream.Seek(0) to reset the read pointer to the beginning of the MemoryStream before trying to load it using the Imaging SDK).

    I know it's merely a workaround but the best I can offer you right now.

  3. #3
    Registered User
    Join Date
    Oct 2013
    Posts
    2

    Re: Unable to use downloaded image stream

    Yes, that works. Yesterday I ran out of ideas and that's why I created this post. I think this will be useful for somebody else in the future.

    You can see the answer in StackOverflow also http://stackoverflow.com/questions/1...ia-imaging-sdk


    Thanks for your help.

Similar Threads

  1. Not completely downloaded while opening stream
    By nwoedf in forum Mobile Java Networking & Messaging & Security
    Replies: 12
    Last Post: 2009-08-24, 15:45
  2. Save Downloaded Image
    By devdattac in forum Mobile Java General
    Replies: 4
    Last Post: 2008-10-10, 06:43
  3. Unable to handle the downloaded file
    By S.S.Sudhakar in forum Symbian
    Replies: 0
    Last Post: 2004-12-30, 11:31
  4. Image Downloaded but not not shown
    By nitinchandola in forum Digital Rights Management & Content Downloading
    Replies: 0
    Last Post: 2004-06-07, 15:01
  5. Can I save downloaded image to galary
    By abovesun in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2003-11-18, 07:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •