Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PlaneProjection Class

July 28, 2014

Represents a perspective transform (a 3-D-like effect) on an object.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

'Declaration
Public NotInheritable Class PlaneProjection _
	Inherits Projection
<PlaneProjection .../>

The PlaneProjection type exposes the following members.

  NameDescription
Public methodPlaneProjectionInitializes a new instance of the PlaneProjection class.
Top

  NameDescription
Public propertyCenterOfRotationXGets or sets the x-coordinate of the center of rotation of the object you rotate.
Public propertyCenterOfRotationYGets or sets the y-coordinate of the center of rotation of the object you rotate.
Public propertyCenterOfRotationZGets or sets the z-coordinate of the center of rotation of the object you rotate.
Public propertyDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertyGlobalOffsetXGets or sets the distance the object is translated along the x-axis of the screen.
Public propertyGlobalOffsetYGets or sets the distance the object is translated along the y-axis of the screen.
Public propertyGlobalOffsetZGets or sets the distance the object is translated along the z-axis of the screen.
Public propertyLocalOffsetXGets or sets the distance the object is translated along the x-axis of the plane of the object.
Public propertyLocalOffsetYGets or sets the distance the object is translated along the y-axis of the plane of the object.
Public propertyLocalOffsetZGets or sets the distance the object is translated along the z-axis of the plane of the object.
Public propertyProjectionMatrixGets the projection matrix on the PlaneProjection.
Public propertyRotationXGets or sets the number of degrees to rotate the object around the x-axis of rotation.
Public propertyRotationYGets or sets the number of degrees to rotate the object around the y-axis of rotation.
Public propertyRotationZGets or sets the number of degrees to rotate the object around the z-axis of rotation.
Top

  NameDescription
Public methodCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAnimationBaseValueReturns any base value established for a Windows Phone dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberCenterOfRotationXPropertyIdentifies the CenterOfRotationX dependency property.
Public fieldStatic memberCenterOfRotationYPropertyIdentifies the CenterOfRotationY dependency property.
Public fieldStatic memberCenterOfRotationZPropertyIdentifies the CenterOfRotationZ dependency property.
Public fieldStatic memberGlobalOffsetXPropertyIdentifies the GlobalOffsetX dependency property.
Public fieldStatic memberGlobalOffsetYPropertyIdentifies the GlobalOffsetY dependency property.
Public fieldStatic memberGlobalOffsetZPropertyIdentifies the GlobalOffsetZ dependency property.
Public fieldStatic memberLocalOffsetXPropertyIdentifies the LocalOffsetX dependency property.
Public fieldStatic memberLocalOffsetYPropertyIdentifies the LocalOffsetY dependency property.
Public fieldStatic memberLocalOffsetZPropertyIdentifies the LocalOffsetZ dependency property.
Public fieldStatic memberProjectionMatrixPropertyIdentifies the ProjectionMatrix dependency property.
Public fieldStatic memberRotationXPropertyIdentifies the RotationX dependency property.
Public fieldStatic memberRotationYPropertyIdentifies the RotationY dependency property.
Public fieldStatic memberRotationZPropertyIdentifies the RotationZ dependency property.
Top

This class is used to create a perspective transform (a 3-D effect) on an object. For example, you can create the illusion that an object is rotated toward or away from you.

Image with perspective transform

Image with perspective transform applied.

Although the preceding illustration shows a perspective transform applied to a simple image, you can apply one to any UIElement, including controls. For example, you could apply the effect to a Grid that in turn contains a TextBox and Button. Despite the controls being rotated, the user could type into the TextBox and tap the Button (assuming the controls are visible).

Another common scenario for using perspective transforms is to arrange objects in relation to one another to create a 3-D effect, as shown in the following illustration.

Stacking objects to create a 3-D effect

Shows stacking objects in 3d effect.

Besides creating static 3-D effects, you can animate the perspective transform properties to create moving 3-D effects.

PlaneProjection has 12 properties you can use to control the rotation and positioning of an object: RotationX, RotationY, RotationZ, CenterOfRotationX, CenterOfRotationY, CenterOfRotationZ, GlobalOffsetX, GlobalOffsetY, GlobalOffsetZ, LocalOffsetX, LocalOffsetY, and LocalOffsetZ. The following sample allows you to experiment with these properties.

NoteNote:

Perspective transforms are not equivalent to a 3-D engine, however, they can be used to make 2-D content appear as if it is drawn on a 3-D plane.

To apply a perspective transform to a UIElement, set the UIElement object's Projection property to a PlaneProjection. The PlaneProjection defines how the transform is rendered in space. The following example shows a simple case.


<StackPanel Margin="35" Background="Gray">
    <StackPanel.Projection>
        <PlaneProjection RotationX="-35" RotationY="-35" RotationZ="15"  />
    </StackPanel.Projection>
    <TextBlock Margin="10">Type Something Below</TextBlock>
    <TextBox Margin="10"></TextBox>
    <Button Margin="10" Content="Click" Width="100" />
</StackPanel>


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2014 Microsoft