How to save a WriteableBitmap to localfolder using C# in WinRT?
Asked
Active
Viewed 2,701 times
2 Answers
3
You can check WinRT XAML Toolkit for a set of extension methods to do exactly what you need: http://winrtxamltoolkit.codeplex.com/SourceControl/changeset/view/0657c67a93d5#WinRTXamlToolkit%2fImaging%2fWriteableBitmapSaveExtensions.cs

Filip Skakun
- 31,624
- 6
- 74
- 100
0
Here are bits and pieces of the answer
var bitmap = new WriteableBitmap(width,height);
var stream = bitmap.PixelBuffer.AsStream();
than you can get IOutputStream
from Stream
to write the data into the local folder.
this post explains how to convert Stream
to byte[]
and this explains how to write byte[]
array to localfolder.
-
1That would lead to writing pixel data directly to a file though. Wouldn't you rather compress it to a well known format? – Filip Skakun Oct 24 '12 at 08:06