需要序列化位图图像 silverlight
我需要使用 bitmapImage 序列化自定义类(现在由 xmlIgnore 标记)。 我正在使用 xmlSerialization,但我认为这很糟糕。您对如何序列化我的类有一些想法吗?也许您可以提供一些简单的示例?
class X
{
private BitmapImage someImage;
public BitmaImage{get;set}
}
实际上稍后我会使用WCF服务。 谢谢)
I need serialize custom class with bitmapImage(tagged by xmlIgnore right now).
I'm using xmlSerialization, but I think thats bad.Do you have some ideas how can I serialize my class??Probably you can provide some simple example??
class X
{
private BitmapImage someImage;
public BitmaImage{get;set}
}
Actually later I will be use WCF Service.
Thanks)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将 图像公开为字节数组,例如:
您当然可以使用流转换回来,
StreamSource
属性。You can expose the image as a byte array, e.g.:
You can of course convert back using a stream and the
StreamSource
property.您可以将图像转换为
Base64
字符串。来自此处的示例:You could convert the image to a
Base64
string. Examples from here: