How to serialize an image to a file
-
I need to get an image from the system clipboard (Clipboard.GetImage()) and serialize it to a file. The end goal would be to, at a later time, deserialize this image and put it back in the clipboard. I can't figure out how to successfully serialize the image. I tried creating a serializeable class that contains an image object, but I get the exception "The type System.Drawing.Bitmap was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." I tried using XmlInclude but am either doing it wrong or it does not resolve the problem. Has someone done this before?
Darryl Borden Principal IT Analyst dborden@eprod.com
-
I need to get an image from the system clipboard (Clipboard.GetImage()) and serialize it to a file. The end goal would be to, at a later time, deserialize this image and put it back in the clipboard. I can't figure out how to successfully serialize the image. I tried creating a serializeable class that contains an image object, but I get the exception "The type System.Drawing.Bitmap was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." I tried using XmlInclude but am either doing it wrong or it does not resolve the problem. Has someone done this before?
Darryl Borden Principal IT Analyst dborden@eprod.com
Will
Image.Save()
[^] work for you? /raviMy new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
-
I need to get an image from the system clipboard (Clipboard.GetImage()) and serialize it to a file. The end goal would be to, at a later time, deserialize this image and put it back in the clipboard. I can't figure out how to successfully serialize the image. I tried creating a serializeable class that contains an image object, but I get the exception "The type System.Drawing.Bitmap was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." I tried using XmlInclude but am either doing it wrong or it does not resolve the problem. Has someone done this before?
Darryl Borden Principal IT Analyst dborden@eprod.com
Please avoid cross-posting questions across forums. You don't need to waste the time of one of the people trying to answer your question after somebody else has already answered it.
-
I need to get an image from the system clipboard (Clipboard.GetImage()) and serialize it to a file. The end goal would be to, at a later time, deserialize this image and put it back in the clipboard. I can't figure out how to successfully serialize the image. I tried creating a serializeable class that contains an image object, but I get the exception "The type System.Drawing.Bitmap was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." I tried using XmlInclude but am either doing it wrong or it does not resolve the problem. Has someone done this before?
Darryl Borden Principal IT Analyst dborden@eprod.com