我想XML-Serialize一个复杂类型(类),它具有System.Drawing.Bitmap类型的属性.
/// <summary>
/// Gets or sets the large icon, a 32x32 pixel image representing this face.
/// </summary>
/// <value>The large icon.</value>
public Bitmap LargeIcon { get; set; }
Run Code Online (Sandbox Code Playgroud)
我现在发现使用默认的XML序列化程序序列化Bitmap不起作用,因为它没有公共无参数构造函数,这对于默认的xml序列化程序是必需的.
我知道以下内容:
我宁愿不想引用另一个项目,也不想广泛调整我的类,只允许这些位图的xml序列化.
有没有办法保持这么简单?
非常感谢,马塞尔