因为打印的内容既有HTML里包含了图片,图片是根据数据库信息生成的128码,如果生成图片会使服务器上的无用图片越来越多,有什么办法吗?直接在HTML拼接图片流,应该是行不通的

解决方案 »

  1.   

             MemoryStream ms = new MemoryStream();
              img.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
              //更改Http头
              Response.ClearContent();
              Response.ContentType = "image/gif";
              Response.BinaryWrite(ms.ToArray());
              //Dispose
              gfc.Dispose();
              img.Dispose();
              Response.End();
      

  2.   

    http://hi.baidu.com/rayshow/blog/item/17ce6dc70d7584ded1006028.html