Download Bitmaps in Correct Sequence

pixelpop

Active Member
Licensed User
Longtime User
First, I apologize if I am being really dense about this. I am trying to download a series of bitmaps from my server in the same order that I request them. The closest I have come is to modify the FlickrViewer demo, but each time I click "Connect" the images are loaded in the ImageViews in a random order, not the order I requested them.

So, here is my scenario:

1. Download the filename list into a TextReader
2. Read each line
3. Download the image having the filename in that line
4. Assign that bitmap to either an array of bitmaps or an array of ImageViews such that array(1) contains the image referenced in line 1 of the TextReader, array(2) contains the image referenced in line 2 of the TextReader, etc.

The wall I keep hitting is that the JobDone event is not raised until the main process has run through all of the download commands. And JobDone does not maintain the order in which the job was initiated. For instance, the FlickrViewer demo only displays the images. How would the code differ if the correct caption was displayed with each image?

If anyone can point my in the right direction, that would break a stalemate I have been up against for a couple of weeks now. Thanks.
 
Last edited:

pixelpop

Active Member
Licensed User
Longtime User
At one point or another, I have tried both. As I said, the closest I have come is a modification of your FlickrViewer demo. I have attached my version. Each time (generally) that "Connect" is clicked, the images are placed randomly in the ImageViews.

If run in debug and a break is placed at "ivs(ImageIndex).Bitmap = Job.GetBitmap", the ImageIndex is incremented not one number at a time, but several. So the first break might have ImageIndex = 1 and the next break might have ImageIndex = 4.

If you can get this to consistently assign the downloaded bitmaps to the ImageViews sequentially (first bitmap filename in TextReader goes to ImageView1, second bitmap filename goes to ImageView2, etc.), I will owe you big time.

Thanks.
 

Attachments

  • my_flickrviewer_mods.zip
    10.7 KB · Views: 244
Last edited:
Upvote 0
Top