WinForm的資源檔案中,將PictureBoxImage屬性等非文字內容都轉變成文本保存,這是通過序列化(Serialization)實現的,
Eg:
1將圖片保存至一個XML文件using System.Runtime.Serialization.Formatters.Soap;
2將圖片保存至一個XML文件Stream stream = new FileStream("D:\\Image.xml",FileMode.Create,FileAccess.Write,FileShare.None);
3將圖片保存至一個XML文件SoapFormatter f = new SoapFormatter();
4將圖片保存至一個XML文件Image img = Image.FromFile("D:\\Image.bmp");
5將圖片保存至一個XML文件f.Serialize(stream,img);
6將圖片保存至一個XML文件stream.Close();

相关文章:

  • 2022-02-13
  • 2021-12-08
  • 2021-06-04
  • 2022-12-23
  • 2021-08-24
  • 2021-11-12
猜你喜欢
  • 2021-09-07
  • 2022-01-17
  • 2022-12-23
  • 2022-02-26
  • 2021-07-15
  • 2021-05-28
  • 2022-12-23
相关资源
相似解决方案