把图片用二进制写到xml文件中,网页中的image控件能否显示xml文件中的图片?

beijingbeerman 2005-12-08 10:21:44
把图片用二进制写到xml文件中,网页中的image控件能否显示xml文件中的图片?
...全文
290 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
fffgtao 2006-02-28
  • 打赏
  • 举报
回复
ympeynk 2005-12-30
  • 打赏
  • 举报
回复
给我一个:ympeynk@163.com
shalen520 2005-12-09
  • 打赏
  • 举报
回复
<img src="GetImage.aspx">

然后用GetImage.aspx中读取xml,利用Response.OutputStream来输出图片
itmingong 2005-12-09
  • 打赏
  • 举报
回复
要进行转换
beijingbeerman 2005-12-09
  • 打赏
  • 举报
回复
to liujiwe79(独孤求胜):
有源代码吗?
beijingbeerman 2005-12-09
  • 打赏
  • 举报
回复
不行,picturebox与image不同
benbenye 2005-12-09
  • 打赏
  • 举报
回复
对将二进制转换回来就OK 拉,我用PICTUREBOX可以显示 估计你的也行
shalen520 2005-12-09
  • 打赏
  • 举报
回复
liujiwe79 2005-12-09
  • 打赏
  • 举报
回复
写xml文件的时候要通过方法将图片转换成64位字符串保存,再读的时候将字符串在转换成图片
beijingbeerman 2005-12-09
  • 打赏
  • 举报
回复
beijingbeerman 2005-12-09
  • 打赏
  • 举报
回复
我解决了,图片写成二进制存入xml传到另一个数据库把二进制存入数据库,再用image控件显示出来。如果需要源码请留下email
BearRui 2005-12-09
  • 打赏
  • 举报
回复
WinForm的资源文件中,将PictureBox的Image属性等非文字内容都转变成文本保存,这是通过序列化(Serialization)实现的,
例子://
using System.Runtime.Serialization.Formatters.Soap;
Stream stream = new FileStream("E:\\Image.xml",FileMode.Create,FileAccess.Write,FileShare.None);
SoapFormatter f = new SoapFormatter();
Image img = Image.FromFile("E:\\Image.bmp");
f.Serialize(stream,img);
stream.Close();

------------------
读出来就用
SoapFormatter.DeSerialize()方法,具体用法可参考MSDN
holym 2005-12-09
  • 打赏
  • 举报
回复
我用sqlserver数据库实现的图片存入&读取
http://blog.csdn.net/holym/category/158048.aspx

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧