原文: How to convert BitmapImage to WriteableBitmap in Universal application for windows 10?

您可以直接从文件将图像加载到WriteableBitmap对象。

var filePicker = new FileOpenPicker();
filePicker.FileTypeFilter.Add(".jpg");
var result = await filePicker.PickSingleFileAsync(); if (result != null)
{
using (IRandomAccessStream stream = await result.OpenAsync(FileAccessMode.Read))
{
BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
WriteableBitmap bmp = new WriteableBitmap((int)decoder.PixelWidth, (int)decoder.PixelHeight);
bmp.SetSource(stream); // show the image in the UI if you want.
MyImage.Source = bmp;
}
}
这样你可以使用WriteableBitmap,你可以使用WriteableBitmapEx库。

  

在UWP 将BitmapImage转换为 WriteableBitmap的更多相关文章

  1. win10 uwp 读取保存WriteableBitmap 、BitmapImage

    我们在UWP,经常使用的图片,数据结构就是 BitmapImage 和 WriteableBitmap.关于 BitmapImage 和 WriteableBitmap 区别,我就不在这里说.主要说的 ...

  2. WriteableBitmap/BitmapImage/MemoryStream/byte[]相互转换

    1 WriteableBitmap/BitmapImage/MemoryStream/byte[]相互转换 2012-12-18 17:27:04|  分类: Windows Phone 8|字号 订 ...

  3. 【WPF】WriteableBitmap和BitmapImage的相互转换

    public BitmapImage ConvertWriteableBitmapToBitmapImage(WriteableBitmap wbm) { BitmapImage bmImage = ...

  4. 【转】【WPF】WriteableBitmap应用及图片数据格式转换

    使用 WriteableBitmap 类基于每个框架来更新和呈现位图.这对于生成算法内容(如分形图像)和数据可视化(如音乐可视化工具)很有用. WriteableBitmap 类使用两个缓冲区.“后台 ...

  5. 13、在 uwp应用中,给图片添加高斯模糊滤镜效果(一)

    如果在应用中,如果想要给app 添加模糊滤镜,可能第一想到的是第三方类库,比如 Win2d.lumia Imaging SDK .WriteableBitmapEx,不可否认,这些类库功能强大,效果也 ...

  6. WPF Image控件 Source: Byte[] ,BitmapImage 相互转换

    文件转为byte[] FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read); byte[] desBytes ...

  7. WriteableBitmap(一)

    通常,WPF中的位图是不可变的.不可变的位图非常有效,如果您希望进行大量的动态更改,创建和销毁它们的开销会变得非常昂贵.在这种情况下,您需要一些更灵活的东西——WriteableBitmap. Wri ...

  8. 2018-8-10-win10-uwp-读取保存WriteableBitmap-、BitmapImage

    title author date CreateTime categories win10 uwp 读取保存WriteableBitmap .BitmapImage lindexi 2018-08-1 ...

  9. windows rt 扫描二维码

    项目中使用的是ZXing.net,应用商店程序.使用到的dll是ZXing.winmd. 大致思路为,使用MediaCapture捕获图片.获取到CapturePhotoToStreamAsync流, ...

随机推荐

  1. amazeui中内置的web组件有哪些且如何用

    amazeui中内置的web组件有哪些且如何用 一.总结 一句话总结: 1.组件还是jquery.js+amazeui.js,和插件一样,准确的说是amazeui.css+jquery.js+amaz ...

  2. Erlang 转至维基百科

    Erlang(英语发音:/ˈɜrlæŋ/)是一种通用的并行程序设计语言,它由乔·阿姆斯特朗(Joe Armstrong)在瑞典电信设备制造商爱立信所辖的计算机科学研究室开发,目的是创造一种可以应付大规 ...

  3. 原生H5页面模拟APP左侧滑动删除效果

    话不多说,往左侧滑动,显示删除,我们先来看一下效果图:如下: 这个布局我就不多说,反正就是一行ul,li, class名“item” js代码如下: $(".item").on(& ...

  4. SQLite做为本地缓存的应用需要注意的地方

    原文:SQLite做为本地缓存的应用需要注意的地方 今天看到了园友陆敏计的一篇文章<<C#数据本地存储方案之SQLite>>, 写到了SQLite的诸多优点,尤其适应于本地数据 ...

  5. Power control within a coherent multi-processing system

    Within a multi-processing system including a plurality of processor cores 4, 6operating in accordanc ...

  6. BZOJ 2818 Gcd 线性欧拉筛(Eratosthenes银幕)

    标题效果:定整N(N <= 1e7),乞讨1<=x,y<=N和Gcd(x,y)素数的数(x,y)有多少.. 思考:推,. 建立gcd(x,y) = p,然后,x / p与y / p互 ...

  7. 用C语言编写简单的病毒

    [摘要]在分析病毒机理的基础上,用C语言写了一个小病毒作为实例,用TURBOC2.0实现. [Abstract] This paper introduce the charateristic of t ...

  8. Java入门程序

    JavaC.exe 编译器,编译.java文件 Java.exe 解释器,执行class文件 编译命令  javac HelloWorld.java 编译后 会产生同名的.class文件 javac编 ...

  9. 【19.27%】【codeforces 618D】Hamiltonian Spanning Tree

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  10. apt-get install 的参数(add-apt-repository)

    apt-get install 是 ubuntu 下的软件安装命令. sudo apt-get -y install: -y:yes,在命令行交互提示中,直接输入 yes: 1. 使用 add-apt ...