DistantLight 类

定义

在一个方向上发出光的无限远的光源。 例如,可以使用远光来表示阳光。

public ref class DistantLight sealed : CompositionLight
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DistantLight final : CompositionLight
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
class DistantLight final : CompositionLight
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DistantLight : CompositionLight
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
public sealed class DistantLight : CompositionLight
Public NotInheritable Class DistantLight
Inherits CompositionLight
继承
Object Platform::Object IInspectable CompositionObject CompositionLight DistantLight
属性

示例

_distantLight = _compositor.CreateDistantLight(); 
_distantLight.Color = Colors.Yellow; 
_distantLight.Direction = new Vector3(0,-1, 0); 
_distantLight.CoordinateSpace = root; 
_distantLight.Targets.Add(root); 

注解

DistantLights 和 SpotLights 支持方向。

DistantLight 是派生自 CompositionLight 的四种光类型之一。

说明

注意

(PointLight、SpotLight 或 DistantLight) ,一个视觉对象不能成为两个以上非环境光的目标。

属性

Color

发出的 DistantLight 的颜色。

Comment

要与 CompositionObject 关联的字符串。

(继承自 CompositionObject)
Compositor

用于创建此 CompositionObject 的 Compositor

(继承自 CompositionObject)
CoordinateSpace

用于确定光线方向的视觉对象。 光线的 Direction 属性相对于此视觉对象的坐标空间。

**CoordinateSpace**

是必需属性。 如果未设置 坐标空间则不会呈现 DistantLight

Direction

光线指向的方向,相对于其 坐标空间 视觉对象指定。

DispatcherQueue

获取 CompositionObject 的 DispatcherQueue。

(继承自 CompositionObject)
ExclusionsFromTargets

获取不以光线为目标的视觉对象的集合。

(继承自 CompositionLight)
ImplicitAnimations

附加到此对象的隐式动画集合。

(继承自 CompositionObject)
Intensity

获取或设置光线的强度。

IsEnabled

获取或设置一个值,该值确定是否打开合成灯。

(继承自 CompositionLight)
Properties

CompositionObject 关联的属性的集合。

(继承自 CompositionObject)
Targets

以光线为目标的视觉对象的集合。

(继承自 CompositionLight)

方法

Close()

关闭 CompositionObject 并释放系统资源。

(继承自 CompositionObject)
Dispose()

执行与释放或重置非托管资源关联的应用程序定义的任务。

(继承自 CompositionObject)
PopulatePropertyInfo(String, AnimationPropertyInfo)

定义可进行动画处理的属性。

(继承自 CompositionObject)
StartAnimation(String, CompositionAnimation)

使用 对象的指定属性连接动画并启动动画。

(继承自 CompositionObject)
StartAnimation(String, CompositionAnimation, AnimationController)

使用 对象的指定属性连接动画并启动动画。

(继承自 CompositionObject)
StartAnimationGroup(ICompositionAnimationBase)

启动动画组。

CompositionObject 上的 StartAnimationGroup 方法可用于启动 CompositionAnimationGroup。 组中的所有动画将同时在 对象上启动。

(继承自 CompositionObject)
StopAnimation(String)

断开动画与指定属性的连接并停止动画。

(继承自 CompositionObject)
StopAnimationGroup(ICompositionAnimationBase)

停止动画组。

(继承自 CompositionObject)
TryGetAnimationController(String)

返回指定属性上运行的动画的 AnimationController。

(继承自 CompositionObject)

适用于

另请参阅