This sample demonstrates how to use two-dimensional transforms to modify how elements are displayed in your app. A transform defines how to map, or transform, points from one coordinate space to another coordinate space.
Specifically, this sample covers:
- Simple 2-D transforms (RotateTransform, ScaleTransform, SkewTransform, and TranslateTransform). These classes enable you to transform an object without knowing how the underlying matrix structure is configured. Note that the sample code actually uses CompositeTransform in order to make the sample interactive. However, the properties provided to the CompositeTransform could just as easily be applied to one of the simple transforms where those properties are relevant. For example, the TranslateX and TranslateY values could be set on TranslateTransform as the X and Y values.
- Using MatrixTransform and setting up a Matrix. This enables you to create transforms that can't be easily expressed as one of the simple 2-D transforms.
- 3-D projections of 2-D elements using PlaneProjection. This class enables you to create 3-D rotation and translation effects.
- Using Matrix3DProjection and setting up a Matrix3D to create complex 3-D transforms.
Common transformation properties where you might apply a transform include:
- Brush.Transform
- Brush.RelativeTransform
- UIElement.RenderTransform
- Geometry.Transform
- Shape.GeometryTransform
To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.
To obtain an evaluation copy of Microsoft Visual Studio 2013, go to Visual Studio 2013.
Note For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.
Related topics
- Roadmaps
- Roadmap for C# and Visual Basic
- Samples
- Windows 8 app samples
- Reference
- CompositeTransform
- MatrixTransform
- PlaneProjection
- Matrix3DProjection
- Concepts
- 3-D effects for apps using XAML
Operating system requirements
| Client | |
|---|---|
| Server |
Build the sample
-
Start Visual Studio and select File > Open > Project/Solution.
-
Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Microsoft Visual Studio Solution (.sln) file.
-
Press F7 or use Build > Build Solution to build the sample.
Run the sample
To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.