加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

将图片保存到一个XML文件

发布时间:2020-12-15 22:49:57 所属栏目:百科 来源:网络整理
导读:转自:blog.csdn.net/chinajiyong/article/details/7209048 [csharp] view plain copy 将图片保存到一个XML文件 WinForm的资源文件中,将PictureBox的Image属性等非文字内容都转变成文本保存,这是通过序列化(Serialization)实现的, 例子: // using Syst
转自: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();

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读