1
ありがとうございます..wp7でダウンロードした画像を知るには?
私はいくつかのイメージをサーバーから自分のwp7アプリケーションにダウンロードしています。そのために私は次のコードを使用しています。
ObservableCollection<BitmapImage> biList;
int currentItem;
private void DownloadImages(string[] imageUriList)
{
biList = new ObservableCollection<BitmapImage>();
BitmapImage bi;
for (int i = 0; i < imageUriList.Length; i++)
{
bi = new BitmapImage();
biList.Add(bi);
bi.UriSource = new Uri(imageUriList[i], UriKind.Absolute);
biList[i] = bi;
}
}
はその後、私は私のWindows Phoneアプリケーションで
<Image />
コントロールにこれらの画像を一枚ずつを示しています。 「次へ」または「前」ボタンをクリックすると表示画像
private void ShowImages()
{
imgImage.Source = biList[0];
currentItem = 1;
}
や画像のため、私は次のコードを使用してい
<Image x:Name="imgImage" />
が変更されています。
private void btnNext_Click(object sender, RoutedEventArgs e)
{
if(currentItem < biList.Count)
{
imgImage.Source = biList[currentItem];
currentItem += 1;
}
}
private void btnPrevious_Click(object sender, RoutedEventArgs e)
{
if(currentItem > 1)
{
imgImage.Source = biList[currentItem-2];
currentItem -= 1;
}
}
これらの画像を表示しようとすると、しばらくすると一部の画像が表示されます。
画像が完全にダウンロードされるようにするにはどうすればよいですか?
は、私はいくつかの 'DownloadStringCompleted'イベントがあるだろうと思います。 –