Im currently trying to Convert an IBuffer I get from a RenderTargetBitmap to a Base64String and vice versa. I successfully did something like that in Silverlight, but now in Windows Runtime there are so many libraries missing that i dont know what to try now.
Below is my latest sample codes which doesnt make any errors, but it lets crash my App when i try to run it. Any suggestions?
Thanks in advance
var bitmap = new RenderTargetBitmap();
await bitmap.RenderAsync(drawingPanel);
IBuffer pixel = await bitmap.GetPixelsAsync();
String b64 = CryptographicBuffer.EncodeToBase64String(pixel);
IBuffer backpixel = CryptographicBuffer.DecodeFromBase64String(b64);
WriteableBitmap wb = new WriteableBitmap(bitmap.PixelWidth, bitmap.PixelHeight);
wb.SetSource(backpixel.AsStream().AsRandomAccessStream());
imageBox.Source = wb;
imageBox is a XAML element to check out if the conversion was successful
EDIT: I get no exceptions with this code, the app just freezes
Use the below, I think I will work