user3064847
user3064847

Reputation: 373

How to convert WritableBitmap to Base64 string

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?

Upvotes: 1

Views: 557

Answers (1)

Filip Skakun
Filip Skakun

Reputation: 31724

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.

Upvotes: 1

Related Questions