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#
基础教程推荐
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- SSE 浮点算术是否可重现? 2022-01-01