WinRT 的 WriteableBitmap 不再允许随机访问像素数据?
WinRT 的 WriteableBitmap 类的变化之一是,它现在具有 IBuffer 类型的 PixelBuffer,而不是将 Pixels 属性公开为数组。
问题是 IBuffer 没有任何方法来随机访问数据。我可以创建一个 DataReader 并一次获取一份数据并将数据复制到数组中以进行随机访问,但不能直接访问 IBuffer 数据。我该如何做到这一点,或者这是不可能的?
One of the changes in WinRT's WriteableBitmap class is that, instead of exposing a Pixels property as an array, it now has a PixelBuffer of type IBuffer.
The problem is that IBuffer doesn't have any way to do random access to the data. I can create a DataReader and get the data one piece at a time and copy the data to an array for random access, but no direct access to the IBuffer data. How do I do this, or is it impossible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎 完全相同的讨论 发生在 MSDN 论坛上。
目前,似乎没有直接的像素操作,但是可以通过使用流来解决问题(正如您已经注意到的)。
考虑到所有因素,这是一个开发人员预览版,该功能可能会在以后的版本中添加。
Seems like the exact same discussion happened over at the MSDN Forums.
For now, it doesn't appear that direct pixel manipulation is there, but there are work arounds by working with streams (as you have already noted).
All things considered, it is a developer preview and the functionality may be added in a later build.