Viewport2DVisual3D 類別

定義

在指定的 3D 檢視區界限內呈現 2D 子系。

public ref class Viewport2DVisual3D sealed : System::Windows::Media::Media3D::Visual3D
[System.Windows.Markup.ContentProperty("Visual")]
public sealed class Viewport2DVisual3D : System.Windows.Media.Media3D.Visual3D
[<System.Windows.Markup.ContentProperty("Visual")>]
type Viewport2DVisual3D = class
    inherit Visual3D
Public NotInheritable Class Viewport2DVisual3D
Inherits Visual3D
繼承
屬性

範例

下列範例示範如何在 3D 物件上放置按鈕、2D 物件。 請注意,您必須在想要放置 2D 視覺效果的材質上設定 IsVisualHostMaterial 附加屬性。

<Viewport3D>
    <Viewport3D.Camera>
        <PerspectiveCamera Position="0, 0, 4"/>
    </Viewport3D.Camera>
    
    <!-- Button on 3D -->
    <Viewport2DVisual3D>
        <!-- Give the plane a slight rotation -->
        <Viewport2DVisual3D.Transform>
            <RotateTransform3D>
                <RotateTransform3D.Rotation>
                    <AxisAngleRotation3D Angle="40" Axis="0, 1, 0" />
                </RotateTransform3D.Rotation>
            </RotateTransform3D>
        </Viewport2DVisual3D.Transform>
        
        <!-- The Geometry, Material, and Visual for the Viewport2DVisual3D -->
        <Viewport2DVisual3D.Geometry>
            <MeshGeometry3D Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0"
                            TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/>
        </Viewport2DVisual3D.Geometry>

        <Viewport2DVisual3D.Material>
            <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>
        </Viewport2DVisual3D.Material>                               
        
        <Button>Hello, 3D</Button>
    </Viewport2DVisual3D>
    
    <!-- Lights -->
    <ModelVisual3D>
        <ModelVisual3D.Content>
            <DirectionalLight Color="#FFFFFFFF" Direction="0,0,-1"/>
        </ModelVisual3D.Content>
    </ModelVisual3D>
</Viewport3D>

備註

Viewport2DVisual3D 可讓您在 3D 物件上放置互動式 2D 內容。 其對應專案是 Viewport3DVisual 類別,這是具有 3D 子系的 2D 視覺效果。

Viewport2DVisual3D.NET Framework 3.5 版引進。

建構函式

Viewport2DVisual3D()

初始化 Viewport2DVisual3D 類別的新執行個體。

欄位

CacheModeProperty

識別 CacheMode 相依性屬性。

GeometryProperty

識別 Geometry 相依性屬性。

IsVisualHostMaterialProperty

識別 IsVisualHostMaterial 附加屬性。

MaterialProperty

識別 Material 相依性屬性。

VisualProperty

識別 Visual 相依性屬性。

屬性

CacheMode

取得或設定 Viewport2DVisual3D 的快取表示。

DependencyObjectType

取得包裝 DependencyObjectType 這個實例 CLR 型別的 。

(繼承來源 DependencyObject)
Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObject

(繼承來源 DispatcherObject)
Geometry

取得或設定這個 Viewport2DVisual3D 的 3D 幾何圖形。

HasAnimatedProperties

取得值,這個值表示這個 Visual3D 是否有任何動畫屬性。

(繼承來源 Visual3D)
IsSealed

取得值,這個值表示此執行個體目前是否已密封 (唯讀)。

(繼承來源 DependencyObject)
Material

取得或設定描述 3D 物件外觀的材質。

Transform

取得或設定套用至 3D 物件的轉換。

(繼承來源 Visual3D)
Visual

取得或設定要放置在 3D 物件上的 2D 視覺物件。

Visual3DChildrenCount

取得 Visual3D 物件的子項目數目。

(繼承來源 Visual3D)
Visual3DModel

取得或設定要轉譯之 Model3D 物件的名稱。

(繼承來源 Visual3D)

附加屬性

IsVisualHostMaterial

取得或設定值,這個值會指定材質是否應為互動式。

方法

AddVisual3DChild(Visual3D)

定義兩個 3D 視覺物件之間的父子關係。

(繼承來源 Visual3D)
ApplyAnimationClock(DependencyProperty, AnimationClock)

套用指定 AnimationClock 的效果至指定相依性屬性。

(繼承來源 Visual3D)
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

套用指定 AnimationClock 的效果至指定相依性屬性。 新 AnimationClock 對任何目前動畫的效果,是由 handoffBehavior 參數的值所決定。

(繼承來源 Visual3D)
BeginAnimation(DependencyProperty, AnimationTimeline)

根據指定的 AnimationTimeline,初始化 DependencyProperty 物件的動畫序列。

(繼承來源 Visual3D)
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)

根據指定的 DependencyPropertyAnimationTimeline,初始化 HandoffBehavior 物件的動畫序列。

(繼承來源 Visual3D)
CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObject

(繼承來源 DispatcherObject)
ClearValue(DependencyProperty)

清除屬性的區域數值。 要清除的屬性是由 DependencyProperty 識別項所指定。

(繼承來源 DependencyObject)
ClearValue(DependencyPropertyKey)

清除唯讀屬性的區域數值。 要清除的屬性是由 DependencyPropertyKey 所指定。

(繼承來源 DependencyObject)
CoerceValue(DependencyProperty)

強制轉型所指定相依性屬性的值。 完成方式是叫用存在於呼叫 DependencyObject 之相依性屬性的屬性中繼資料中所指定的任何 CoerceValueCallback 函式。

(繼承來源 DependencyObject)
Equals(Object)

判斷提供的 DependencyObject 和目前的 DependencyObject 是否相等。

(繼承來源 DependencyObject)
FindCommonVisualAncestor(DependencyObject)

傳回視覺物件的共同祖系以及另一個指定之視覺物件。

(繼承來源 Visual3D)
GetAnimationBaseValue(DependencyProperty)

擷取指定之 DependencyProperty 物件的基底實值。

(繼承來源 Visual3D)
GetHashCode()

取得這個 DependencyObject 的雜湊碼。

(繼承來源 DependencyObject)
GetIsVisualHostMaterial(Material)

取得所指定 UIElementIsVisualHostMaterial 附加屬性值。

GetLocalValueEnumerator()

建立特定的列舉值,以判斷哪些相依性屬性在此 DependencyObject 上具有本機設定的值。

(繼承來源 DependencyObject)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
GetValue(DependencyProperty)

傳回 DependencyObject 的這個執行個體上之相依性屬性的目前有效值。

(繼承來源 DependencyObject)
GetVisual3DChild(Int32)

傳回父 Visual3D 中所指定的 Visual3DCollection

(繼承來源 Visual3D)
InvalidateProperty(DependencyProperty)

重新評估指定相依性屬性的有效值。

(繼承來源 DependencyObject)
IsAncestorOf(DependencyObject)

判斷視覺物件是否為子系視覺物件的祖系。

(繼承來源 Visual3D)
IsDescendantOf(DependencyObject)

判斷視覺物件是否為祖系視覺物件的子系。

(繼承來源 Visual3D)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

每當這個 DependencyObject 上任何相依性屬性的有效值已更新時叫用。 已變更的特定相依性屬性會在事件資料中報告。

(繼承來源 DependencyObject)
OnVisualChildrenChanged(DependencyObject, DependencyObject)

當視覺物件的 Visual3DCollection 已修改時呼叫。

(繼承來源 Visual3D)
OnVisualParentChanged(DependencyObject)

在 3D 視覺物件的父代變更時呼叫。

(繼承來源 Visual3D)
ReadLocalValue(DependencyProperty)

傳回相依性屬性的區域值 (如果存在)。

(繼承來源 DependencyObject)
RemoveVisual3DChild(Visual3D)

移除兩個 3D 視覺物件之間的父子關係。

(繼承來源 Visual3D)
SetCurrentValue(DependencyProperty, Object)

設定相依性屬性的值,而不需要變更其值來源。

(繼承來源 DependencyObject)
SetIsVisualHostMaterial(Material, Boolean)

IsVisualHostMaterial 附加屬性的值設定為指定的元素。

SetValue(DependencyProperty, Object)

設定相依性屬性的區域值 (由相依性屬性的識別碼所指定)。

(繼承來源 DependencyObject)
SetValue(DependencyPropertyKey, Object)

設定唯讀相依性屬性的區域數值 (由相依性屬性的 DependencyPropertyKey 識別項所指定)。

(繼承來源 DependencyObject)
ShouldSerializeProperty(DependencyProperty)

傳回值,這個值表示序列化程序是否應該序列化所提供相依性屬性的值。

(繼承來源 DependencyObject)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
TransformToAncestor(Visual)

傳回轉換,這個轉換可用來將這個 Visual3D 物件的座標轉換為物件的指定 Visual 祖系。

(繼承來源 Visual3D)
TransformToAncestor(Visual3D)

傳回轉換,這個轉換可用來將這個 Visual3D 物件的座標轉換為物件的指定 Visual3D 祖系。

(繼承來源 Visual3D)
TransformToDescendant(Visual3D)

傳回轉換,可用於將這個 Visual3D物件中的座標轉換為指定的 Visual3D 世系物件。

(繼承來源 Visual3D)
VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。

(繼承來源 DispatcherObject)

適用於