我有一个zip邮箱,我已经完成了zip文件解压缩文件。在解压缩文件中有4到5个图像是jpg。如何将这些图像显示在页面中..
private void openReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
UnZipper unzip = new UnZipper(e.Result);
foreach (string filename in unzip.GetFileNamesInZip())
{
Stream stream = unzip.GetFileStream(filename);
StreamReader reader = new StreamReader(stream);
string contents = reader.ReadToEnd();
MessageBox.Show(contents);
}
}
请帮助..............................
答案 0 :(得分:1)
试试这个,使用imgCtr是你的Image Control页面。
private void openReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
UnZipper unzip = new UnZipper(e.Result);
foreach (string filename in unzip.GetFileNamesInZip())
{
Stream stream = unzip.GetFileStream(filename);
BitmapImage image = new BitmapImage();
image.SetSource(stream);
imgCtr.Source = image;
}
}