سؤال

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