#805 – Some Examples of Transform Strings

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”

805-001

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

805-002

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

805-003

 

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

805-004

 

Advertisements