#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”


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”




About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #805 – Some Examples of Transform Strings

  1. Pingback: Dew Drop – April 24, 2013 (#1,534) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: