-1

Possible Duplicate:
WPF BitmapImage Serialization/Deserialization

I have class I have to seriazlize this class

class X{
....
public BitmapImage SomeImage{ get; set; }
....
}

That's my logic for serializing object

XmlSerializer serializer = new XmlSerializer(typeof(X));
 serializer.Serialize(way, person);

I'm using XmlIgnore attribute that not serialize image.But i Have to serialize picture.How I have to do it?Please help me.

Community
  • 1
  • 1
Thomas Wingfield
  • 95
  • 1
  • 3
  • 7

1 Answers1

0

The best way to do it is to transform the BitmapImage in a byte[] and then serialize it to the XML. I'm doing it in my project and it works.

Here's how to do it: WPF BitmapImage Serialization/Deserialization

Community
  • 1
  • 1
blop
  • 103
  • 9