将图片保存到一个XML文件

转自:blog.csdn.net/chinajiyong/article/details/7209048
[csharp]
view plain copy
  1. 将图片保存到一个XML文件
  2. WinForm的资源文件中,将PictureBox的Image属性等非文字内容都转变成文本保存,这是通过序列化(Serialization)实现的,
  3. 例子://
  4. usingSystem.Runtime.Serialization.Formatters.Soap;
  5. Streamstream=newFileStream("E:\\Image.XML",FileMode.Create,FileAccess.Write,FileShare.None);
  6. SoapFormatterf=newSoapFormatter();
  7. Imageimg=Image.FromFile("E:\\Image.bmp");
  8. f.Serialize(stream,img);
  9. stream.Close();

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念