asp.net中如何显示tif格式的图片,急!!! 我有个页面frmFaxView.aspx我想在页面中显示tif格式的图片,一直没解决,希望高手帮助! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 首先,tif因其精度较高而未被讲究速度的网络图片格式所采纳,其二,现在的tif已朝层式位图(如psd)发展!所以以后的网络图片格式也不太可能支持采纳这种格式。因此比较好的方法是: 先用acdsee批量转化你的tif图为同名的jpg图,然后给jpg图做个链接到tif文件,这样你就可以用jpg排版,人家也可以比较快地看到你的tif模样,又可以点击jpg下载tif,不是两全其美吗? 由于项目本身因素在程序外是不可以改变tif格式的希望朋友们能给点在程序内部转换的方法或者其他谢谢!! 单页tif可以。。多页的我也在找方法。。//从文件取得图片对象 System.Drawing.Image image = System.Drawing.Image.FromFile(strTifPath); //uploadTif 中tif图形文件//取得图片大小 System.Drawing.Size size = new System.Drawing.Size((int)intWidth, (int)intHeight); //新建一个bmp图片 System.Drawing.Image bitmap = new System.Drawing.Bitmap(size.Width, size.Height); //新建一个画板 System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap); //设置高质量插值法 g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; //设置高质量,低速度呈现平滑程度 g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; //清空一下画布 g.Clear(System.Drawing.Color.White); //在指定位置画图 g.DrawImage(image, new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), new System.Drawing.Rectangle(0, 0, image.Width, image.Height), System.Drawing.GraphicsUnit.Pixel); //保存高清晰度的缩略图 //bitmap.Save(strNewFilePath, System.Drawing.Imaging.ImageFormat.Tiff); //uploadTif 中tif文件 System.IO.MemoryStream ms = new System.IO.MemoryStream(); bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); Response.ClearContent(); Response.ContentType = "image/Jpeg"; Response.BinaryWrite(ms.ToArray()); g.Dispose(); image.Dispose(); bitmap.Dispose(); //获取当前页 image.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, intNowPage); asp.net判断是否按了组合键 帮忙解决 请问如何在一个web窗体里引入一个水晶报表的窗体。 请问(2005-11-19 12:23:00)怎么只能显示2005-11-19 12:23,而不要显示后面的秒呢? [馨郁星愿]DataGird绑定数据并显示的问题~ 求打印控制解决方案!特问:如果用IE打印而不打印网址? 关于XSL?怎么传递参数? 求助ASP.net登陆问题 aspose.word 保存文档时 内容丢失了一部分 怎么解决 调用远程webService访问数据库快还是直接用语句访问远程数据库快? xml有中文字段无法显示,盼解决一下 在FormView中的怎么实现二级联动阿?
希望朋友们能给点在程序内部转换的方法或者其他
谢谢!!
//从文件取得图片对象
System.Drawing.Image image = System.Drawing.Image.FromFile(strTifPath); //uploadTif 中tif图形文件//取得图片大小
System.Drawing.Size size = new System.Drawing.Size((int)intWidth, (int)intHeight);
//新建一个bmp图片
System.Drawing.Image bitmap = new System.Drawing.Bitmap(size.Width, size.Height);
//新建一个画板
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap);
//设置高质量插值法
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
//设置高质量,低速度呈现平滑程度
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
//清空一下画布
g.Clear(System.Drawing.Color.White);
//在指定位置画图
g.DrawImage(image, new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), new System.Drawing.Rectangle(0, 0, image.Width, image.Height), System.Drawing.GraphicsUnit.Pixel);
//保存高清晰度的缩略图
//bitmap.Save(strNewFilePath, System.Drawing.Imaging.ImageFormat.Tiff); //uploadTif 中tif文件 System.IO.MemoryStream ms = new System.IO.MemoryStream();
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ClearContent();
Response.ContentType = "image/Jpeg";
Response.BinaryWrite(ms.ToArray()); g.Dispose();
image.Dispose();
bitmap.Dispose();
image.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, intNowPage);