Viewport 3D WPF C#(视口 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.
您使用 Grid 的方法是正确的,您可能希望使用 Border 来执行使用一个孩子.
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#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:视口 3D WPF C#


基础教程推荐
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01