WP8 Direct3D + Xaml应用程序,WriteableBitmap.Render错误 [英] WP8 Direct3D + Xaml application, WriteableBitmap.Render bug

查看:66
本文介绍了WP8 Direct3D + Xaml应用程序,WriteableBitmap.Render错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


您好,


我遇到问题 WriteableBitmap类
Direct3D(
DrawingSurfaceBackgroundGrid)
与Xaml组合在一起的应用程序中。在我的应用程序中,我使用Direct3D绘制地图,使用Xaml绘制UI。现在我需要创建一些固定到地图的弹出窗口。所以我需要弹出窗口的纹理。我想使用WriteableBitmap.Render()+ Invalidate()方法
来绘制UI,然后我会在Direct3D渲染中将像素复制到我的纹理。 


问题是 WriteableBitmap.Render
在这种情况下 无法正常工作 且渲染结果
  或多或少随机 。第一次
WriteableBitmap.Render
生成 正确的 位图
第二次
生成 空的 位图和 第三次 time it 
生成 数据 既不是
用户界面 为空。

时我 断开连接 "   Direct3D DrawingSurfaceBackground.SetBackgroundContentProvider(nullptr))和
页面看起来没有Direct3D的正常Xaml页面,正常工作正常。
重要提示:
$仅当
应用程序正在运行时,才会发生b $ b 行为 没有
调试器 附加



我准备了 样本
应用程序 上述 - 描述的行为
发​​生。您可以下载
here
。如何使用示例应用程序:


  1. 编译并部署到手机。
  2. 启动它 直接来自手机 -
    没有附加调试器!
  3. < span id ="x_x_result_box"lang ="en"> 定期 点击按钮上的
    渲染UI
    ,直到生成错误或空图像(当发生这种情况时,按钮将跳到页面的另一侧)。
  4. 您可以禁用Direct3D渲染以检查它应该如何工作。


可以吗 建议如何
可靠 渲染 UI
到纹理时 使用 Direct3D 进行
渲染 页面背景 ?在这种情况下,是否存在一些解决方法来纠正WB的这种行为?
$

谢谢。




解决方案

你好Seznam,


它听起来像一个鞭子指针,可能很难追查。 (调试器可能会更改线程优先级,以便您在寻找时所寻找的数据位于同一位置)。


如果没有人能够指出正确的方向,您可以考虑与我们合作,与我们的工程师进行一对一的支持。我和他们一起讨论过,这里有很多可能导致这种情况。如果您有兴趣打开
a支持事件,可以从这个页面开始:
https://gettechsupport.microsoft.com/default.aspx?locale=en-us&supportregion=en-us&pesid=14879&tenant=ClassicCommercial& ccsid = 634871877443390009& wa = wsignin1.0& scrx = 1


-Dan


Hi,

I have a problem with WriteableBitmap class in an application that combines the Direct3D (DrawingSurfaceBackgroundGrid) with Xaml. In my application I use Direct3D to draw map and Xaml to draw UI. Now I need create some popup pinned to the map. So I need texture of the popup. I want use WriteableBitmap.Render() + Invalidate() method to draw UI and then I will copy pixels to my texture in Direct3D render. 

The problem is that WriteableBitmap.Render in this case does not work properly and the render results are more or less random. First timeWriteableBitmap.Render generates the correct bitmap. Second time generates an empty bitmap and third time it  generates data that are neither UI nor empty. But when I "disconnect" Direct3Dfrom a page (DrawingSurfaceBackground.SetBackgroundContentProvider(nullptr)) andthe page looks line normal Xaml page without Direct3D, everithing works OK. Important: This behavior occurs only when the application is running without debugger attached.

I have prepared a sample application where the above-described behavior occurs. You can download it here. How to use sample app:

  1. Compile, and deploy to phone.
  2. Start it directly from phone - no debugger attached!.
  3. Periodically tap on button Render UI until bad or empty image is generated (button will skip to other side of the page when this happen).
  4. You can disable Direct3D render to check how it should work.

Can you please advise how to correctly and reliably render UI to texture when I use Direct3D for rendering the page background? Exist some workaround to correct this behavior of WB in this case?

Thank you.


解决方案

Hello Seznam,

It sounds like a flailing pointer, that could be difficult to track down. (The debugger is likely changing thread priority so that the data your are seeking is in the same place when you go for it).

If no one is able to point you in the right direction here, you might consider opening a case with us to have 1-on-1 support with one of our engineers. I discussed it with them and there is a lot here that could cause this. If you are interested in opening a support incident, you can start through this page: https://gettechsupport.microsoft.com/default.aspx?locale=en-us&supportregion=en-us&pesid=14879&tenant=ClassicCommercial&ccsid=634871877443390009&wa=wsignin1.0&scrx=1

-Dan


这篇关于WP8 Direct3D + Xaml应用程序,WriteableBitmap.Render错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆