This is an evolution of: C# image binary serialization
I have very simple class:
public class TheClass2
{
public object myImg;
public int myInt;
}
In order to serialize it I have to cast myImg from image to object
var ist = new TheClass2();
Image i = new Image();
ist.myImg= Convert.ChangeType(i, typeof(object));<-----this is not working
but ist.myImg is still an image.
Thanx for any help Patrick
Convert.ChangeType()method does. Where did you get the idea that it would serialize your data? As explained in your previous question, you will need to save your image data explicitly in a format appropriate to your scenario. There are lots of ways to do this, all documented on MSDN and described in various Q&As on Stack Overflow.