开发者

How Send WriteableBitmap as byte[] from silverlight client and deserialize to Bitmap on server side?

I sending WriteableBitmap as byte[] from silverlight client - and i want to deserialize the byte[] to Bitmap or Image object in the server side.

How do i de开发者_运维技巧serialize this byte[] ?

Thanks for any help.


Put a method on your WCF service that takes byte[] as a parameter. Have your Silverlight app call that and pass the bytes in.

On the server side, the Image class has a constructor that takes a Stream. So you can create a new MemoryStream(byte[]) with the bytes, and then call Image.FromStream() with the new MemoryStream.

There's probably several other ways to do this, but that one should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜