Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An infinitely large distant light source that emits light in a single direction. For example, a distant light could be used to represent sunlight.
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)] /// [Windows.Foundation.Metadata.WebHostHidden] 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)] [Windows.Foundation.Metadata.WebHostHidden] public sealed class DistantLight : CompositionLight
Public NotInheritable Class DistantLight Inherits CompositionLight
Windows.Foundation.Metadata.ContractVersionAttribute Windows.Foundation.Metadata.MarshalingBehaviorAttribute Windows.Foundation.Metadata.ThreadingAttribute Windows.Foundation.Metadata.WebHostHiddenAttribute
_distantLight = _compositor.CreateDistantLight(); _distantLight.Color = Colors.Yellow; _distantLight.Direction = new Vector3(0,-1, 0); _distantLight.CoordinateSpace = root; _distantLight.Targets.Add(root);
DistantLights and SpotLight s support direction.
DistantLight is one of the four light types derived from CompositionLight.
|@"Microsoft.UI.Composition.AmbientLight?text=AmbientLight"||A light source that emits non directional light that appears to have been reflected by everything in the scene.|
|DistantLight||An infinitely large distant light source that emits light in a single direction.|
|@"Microsoft.UI.Composition.PointLight?text=PointLight"||A point source of light that emits light in all directions.|
|@"Microsoft.UI.Composition.SpotLight?text=SpotLight"||A light source that emits inner and outer cones of light.|
A Visual cannot be targeted by more than two non-ambient lights (PointLight, SpotLight or DistantLight).
Color of the emitted DistantLight.
A string to associate with the CompositionObject.(Inherited from CompositionObject)
The Visual used to determine the light’s direction. The light's Direction property is relative to this Visual’s coordinate space.
is a required property. If CoordinateSpace is not set, the DistantLight will not render.
The direction in which the light is pointing, specified relative to its CoordinateSpace Visual.
Gets the DispatcherQueue for the CompostionObject.(Inherited from CompositionObject)
Gets a collection of Visuals that are not targeted by the light.(Inherited from CompositionLight)
The collection of implicit animations attached to this object.(Inherited from CompositionObject)
Gets or sets the intensity of the light.
Gets or sets a value that determines whether the composition light is on.(Inherited from CompositionLight)
The collection of properties associated with the CompositionObject.(Inherited from CompositionObject)
The collection of Visuals targeted by the light.(Inherited from CompositionLight)
Closes the CompositionObject and releases system resources.(Inherited from CompositionObject)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.(Inherited from CompositionObject)
Defines a property that can be animated.(Inherited from CompositionObject)
Connects an animation with the specified property of the object and starts the animation.(Inherited from CompositionObject)
Starts an animation group.CompositionObject)
Disconnects an animation from the specified property and stops the animation.(Inherited from CompositionObject)
Stops an animation group.(Inherited from CompositionObject)
Returns an AnimationController for the animation running on the specified property.(Inherited from CompositionObject)