我有 viewport3d,我想更改它的背景颜色。
我是 Wpf 的新手。我不明白从其他帖子可以做什么。所以我在这里问。
我更改了 viewport3d 的画笔属性,但它什么也没做
<Window x:Class="W3DTinker.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="800" Width="1200">
<Grid HorizontalAlignment="Left" Height="780" Margin="10,10,0,-21" VerticalAlignment="Top" Width="1180">
<Viewport3D Grid.Row="0" Grid.Column="0" x:Name="Viewport" Margin="350,10,10,10" OpacityMask="{DynamicResource {x:Static SystemColors.AppWorkspaceBrushKey}}" />
</Grid>
请您参考如下方法:
Viewport3D 是一个控件,可以创建 3D 场景供您渲染。它本身不显示任何内容。如果您想要它背后的背景颜色,请在其父控件上设置背景颜色,在您的例子中是包含它的 Grid。
