In my application I am using WriteableBitmapRenderExtensions.Render() method present in WinRT XAML toolkit for rendering xaml element. After rendering the xaml control I need to send this to server in the form of Base64 string. How I can convert this WritableBitmap class in to Base64 string?

有帮助吗?

解决方案

Save the WriteableBitmap to a png or jpg (there's an extension for that in the toolkit that you can probably modify to get the compressed image as byte array) to reduce the data size and then use Convert.ToBase64String() as Chris suggested to convert the bytes to Base64 string.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top