WinRT: how to save WriteableBitmap to localfolder

丶灬走出姿态 提交于 2019-12-04 17:39:07

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

Mayank

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!