I want to XML-Serialize a complex type (class), that has a property of type System.Drawing.Bitmap among others.
/// <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; }
I now have found out that serializing the Bitmap with the default XML serializer does not work, because it does not have a public parameterless constructor, which is mandatory with the default xml serializer.
I am aware of the following:
- There exists a workaround, posted here: http://www.dotnetspider.com/resources/4759-XML-Serialization-C-Part-II-Images.aspx . However since this includes adding another property this seems to me a bit of a hack.
- There is also a deep XML serializing project on sourceforge.
I rather would not like referencing another project nor extensively tweak my class to just allow xml serialization of those bitmaps.
Is there no way to keep that simple?
Many thanks, Marcel