Load BitmapImage into WriteableBitmap but no method existing

混江龙づ霸主 提交于 2019-12-01 13:42:55

Thanks for your help, I succeed to blur my image. Here is the sample in order to link the BitmapImage into the WriteableBitmap object :

BitmapImage bi = new BitmapImage(new Uri(filename, UriKind.RelativeOrAbsolute));
WriteableBitmap wb = new WriteableBitmap(bi.PixelWidth, bi.PixelHeight);

var streamFile = await GetFileStream(myFile);
await wb.SetSourceAsync(streamFile);
wb = wb.Convolute(WriteableBitmapExtensions.KernelGaussianBlur5x5);

Then just write the WriteableBitmap into the LocalStorage !

You should be able to load a BitmapImage into WritableBitmap like this:

WriteableBitmap writableBitmap = new WriteableBitmap(bitmapImage);

See here WriteableBitmap Constructor (BitmapSource)

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