## #805 – Some Examples of Transform Strings

April 24, 2013 1 Comment

You can represent any arbitrary matrix transform in XAML using a simple string which includes the values of the elements of the matrix used to do the transformation. The format is: “M11, M12, M21, M22, OffsetX, OffsetY”.

You can therefore specify any of the standard transforms by also using a simple string in XAML and setting the proper matrix elements. Here are examples of how to do each of the basic transform types using a simple string:

**Scale** Transforms: “ScaleX, 0.0, 0.0, ScaleY, 0.0, 0.0”

**Rotation** transforms: “cos(angle), sin(angle), -sin(angle), cos(angle), 0.0, 0.0”

**Translation** transforms: “1.0, 0.0, 0.0, 1.0, OffsetX, OffsetY”

**Skew** transforms: “1.0, tan(SkewY), tan(SkewX), 1.0, 0.0, 0.0”