视3D WPF C# [英] Viewport 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?
推荐答案
所以你需要它背后的东西Viewport3D不具有Background属性。
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.
<Border Background="Green">
<Viewport3D Width="640.0" Height="480.0" >
<ModelVisual3D/>
</Viewport3D>
</Border>
我假设你正在使用的XamlWriter,XamlReader。只需保存的边界,而不是Viewport3D和边界内的一切都将被保存为好。
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.
这篇关于视3D WPF C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!