Transforms allow manipulating an entity's coordinates in various ways, the most common being translating (moving), scaling, and rotating. This ability provides a lot of flexibility in the way elements (and other objects) present themselves. Combined with animations and some creativity, transforms are even more powerful. In this recipe, we'll examine the ways to use transforms and discuss the available transform types.
We'll create some images and apply a rotation transform to some, showing the common properties that accept transforms:
Create a new WPF application named
CH09.Transforms
.Add an existing image to the project, such as
"penguins.jpg"
from theSample Pictures
folder.Open
MainWindow.xaml
. Add the following properties to theWindow
:SizeToContent="WidthAndHeight" FontSize="16" ResizeMode="CanMinimize"
Remove the
Width
andHeight
property settings of theWindow
.Add three columns...