BitmapImage to byte[] Windows 8 metro (WinRT)(BitmapImage 到字节 [] Windows 8 Metro (WinRT))
问题描述
我想在 Windows 8 应用程序中将 BitmapImage
转换为 byte[].我知道如何使用 windows sdk 来做到这一点,但似乎无法让它适用于 WinRT sdk.
I want to convert BitmapImage
to byte[] in windows 8 application. I know how to do it using windows sdk but can't seem to get it working for WinRT sdk.
一两篇文章建议我应该使用 WritableBitmap
来实现这一点,但没有明确的例子.
One or two posts are suggesting that I should use WritableBitmap
to achieve that but there are no clear examples.
BitmapImage 到字节数组的转换 (Windows)
以下是我发现的最好的,但对我来说仍然太模糊
following is the best I found but still too vague for me
WinRT 将图像加载到字节数组中
我将不胜感激.
推荐答案
你应该看看这里的 WriteableBitmapEx 项目 - http://writeablebitmapex.codeplex.com/ 这里讨论 - WinRT 将图像加载到字节数组中...来自答案...
You should look at the WriteableBitmapEx project here - http://writeablebitmapex.codeplex.com/ It is discussed here - WinRT Loading an Image into a Byte array... from the answer...
基本上你需要将图像加载到 WriteableBitmap 中,然后通过调用 PixelBuffer.AsStream() 访问其像素缓冲区.
Basically you need to load the image into a WriteableBitmap, then access its pixel buffer by calling PixelBuffer.AsStream().
这篇关于BitmapImage 到字节 [] Windows 8 Metro (WinRT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:BitmapImage 到字节 [] Windows 8 Metro (WinRT)


基础教程推荐
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01