视口 3D WPF C#
您能演示一下如何设置和保存 viewport3D 的背景颜色吗?每当我保存没有背景仅可见的模型时,我尝试了网格,但这会获取网格中的所有内容吗?有什么帮助可以吗?
Can you please show how to set and save the background color of the viewport3D. Whenever I save no background is visible only model, I tried the grid but that gets everything in the grid? Any help will do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Viewport3D 没有背景属性,因此您需要在其后面添加一些内容。
您使用网格的方法是正确的,您可能想使用边框来强制执行
使用单个孩子。
我假设您正在使用 XamlWriter、 XamlReader 。只需保存边框而不是 Viewport3D,边框内的所有内容也会被保存。
Viewport3D doesn't have a Background property so you need something behind it.
your approach using a Grid is right, you might want to use a Border to enforce the
use of a single child.
I assume you are using XamlWriter, XamlReader . Just save the border instead of the Viewport3D and everything inside the border will be saved as well.
我为此提供了一些代码,请验证。
I have provided some code for this, please verify it.