向各位请教个问题,是这样的,我现在想把我页面上的一张图片生成一张缩略图Image,然后将缩略图Image以转换的图片类型保存到IStream中,最后再把缩略图从IStream中显示出来, 我要的是把缩略图转换的图片类型保存到IStream中,不要保存到我的硬盘上.不知道大家有没有做过这样的功能,知道的麻烦帮忙告诉一声,先在此谢谢大家了.

解决方案 »

  1.   

    private byte[] PhotoToArray( string path ) 

        FileStream stream = new FileStream( path , FileMode.Open , FileAccess.Read ) ; 
        byte[] bufferPhoto =new byte[stream.Length] ; 
        stream.Read( bufferPhoto,0,Convert.ToInt32( stream.Length ) ) ; 
        stream.Flush(); 
        stream.Close(); 
        return bufferPhoto ; 

    把图片保存成字节流,然后把他读出来就可以了啊
    Response.BinaryWrite((byte[])字节流)
      

  2.   


     //用PicturnBox显示图片
    System.Drawing.Image image = System.Drawing.Image.FromStream(fileStream);
    this.pictureBox1.Image = image;
      

  3.   

    问题是我是在ASP.NET上的,页面上没有pictureBox1这个控件啊
      

  4.   

    ASP.NET页面显示图片好像也就只有Image和ImageMap这两个控件,问题是怎样把文件流显示到这两个控件上