我写了一个逻辑流一通电话,在那里你可以把它保存图像。代码工作的网页浏览器上。但是,当我试图在手机上,将节省的形象,但我不能查看图像。我想在手机上的形象是太大。
当我保存的网页浏览器上的形象,我注意到图像的大小是2KB。在手机上的图像的大小是40KB。我复制,生成图像从网页浏览器的电话,我可以查看它。
我错过电话的东西吗?逻辑工作在手机上一样吗?
:4621605 |会员
string mappath = Server.MapPath(" /TestData/test.jpg");
//Server.MapPath(" /images/CommImages") + "\\";
Bitmap bitmap = new Bitmap(mappath);
using (MemoryStream ms = new MemoryStream())
{
// Send the encoded image to the browser
Response.BufferOutput = false; // to prevent buffering
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.AddHeader("Content-Disposition",
"attachment; filename=USPSTest.jpg");
HttpContext.Current.Response.ContentType = "image/jpeg";
bitmap.SetPixel(10, 10, Color.Red);
bitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
bitmap.Dispose();