i made a web service that returns the name of the images in a file and returns the array of string with the file name with its folder name attached to it i.e. "pictures/image1.jpg".
the client takes the url and adds it to the string i.e "http://localhost:3323/pictures/image1.jpg".

The images is then loaded on the scrollpanel using this code ...

void service_getimagesCompleted(object sender, ServiceReference1.getimagesCompletedEventArgs e)
        {
            string url = "http://localhost:3323";
            string[] files = e.Result.ToArray();
            
           
            foreach (string file in files)
            {
                try
                {
                    System.Windows.Media.Imaging.BitmapImage bi = new System.Windows.Media.Imaging.BitmapImage();
                    bi.UriSource = new Uri(url + "/" + file);
                    
                    Image i = new Image();
                    i.Height = scrollViewer1.Height;
                    i.Width = scrollViewer1.Height;
                    i.Margin = new Thickness(8);
                    i.Source = bi;
                    
                    stackPanel1.Children.Add(i);
                }
                catch { }
            }
            scrollViewer1.UpdateLayout();

But when i execute this...the web browser loads up...and becomes extremely heavy and only loads like 12 images out of 30.
i dont want it to become heavy i.e. allow the web browser to be smooth while the images are loading...

i also want to know why its only loading some of it..and not all of the images...

thank you and waiting for reply!.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.