質問

I want to set picture box from zip file without extract zip. my code:

ZipFile zip = new ZipFile("data.zip");
using (Stream s = zip["p3.png"].OpenReader())
{
    picturebox.ImageLocation = s.ToString();
}

Picture Box Show error image.

役に立ちましたか?

解決

I should use Bitmap. Correct Code:

ZipFile zip = new ZipFile("data.zip");
using (Stream s = zip["p3.png"].OpenReader())
{
    Bitmap bitmap= new Bitmap(s);
    PictureBox picturebox.Image = bitmap;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top