简体   繁体   中英

Viewport3D not updating visuals after performing RenderTargetBitmap

Rendering a Viewport3D with a RenderTargetBitmap.Render call seems to cause the Viewport3D to no longer update its visual content. The interactive actions still work though, such a hover-over and clicking.

I've created an example in which I have a viewport which contains a button. I then render the viewport with RenderTargetBitmap. After this render, I try to toggle the visibility of the button but the visuals of the button no longer update which is unexpected. It is however not possible to click on the button as you would expect when it is collapsed. Toggling back the visibility to visible allows me to click the button again so it seems that only the visuals are no longer processed correctly.

It seems that the viewport loses track of the correct buffer it should use and keeps displaying the old version no matter what. I would like the viewport to just keep updating its visuals as it did before the render call, any ideas what I am missing here?

I've uploaded the demonstrator on bitbucket, the sourcefiles can be viewed here: Sourcecode

The demonstrator is also available as a VS2010 solution: download solution

If you require any other information please let me know, I'll try to answer your questions as detailed as possible.

I was having a similar issue. After the call to RenderTargetBitmap's Render(), I noticed that, for example, any color changes applied to the visuals within the Viewport were not being displayed. As you state, the interactive actions like clicking, rotating, hover-over, etc. were still working.

Within my application the Viewport being rendered was itself sitting inside (ie a child of) a Grid. I found that if, after the call to RenderTargetBitmap's Render() method, I removed the Viewport from and then readded the Viewport to the Grid's 'Children' list, the visuals within the Viewport continued to update as they did before the call to Render().

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM