MatrixTransform in XAML Silverlight



Introduction

In Silverlight "MatrixTransform" creates an arbitrary affine matrix transformation that manipulates objects or coordinate systems in a two-dimensional plane. Matrix Transformation is a subject of Mathematical calculation and it's not really as complicated as it looks. Well, look at some properties of MatrixTransform that are important to know; consider the screenshot too:

Matrix1.gif

Attributes of MatrixTransformation

  • M11 (Default value 1)

    This is the value at position (1, 1) as in Mathematics; if you are confused then let me explain. M11 is just a point at position (1, 1). If element (here Grid) has the width 250 (look in screenshot below) it will be considered as 1. If we doubled the value of M11 from 1 to 2 then the transformed size will be about (250x2) 500.

    Matrix2.gif
     
  • M12 (Default value 0)

    This is the value at position (1, 2) as in Mathematics. Look at the screenshot for more of an explanation.

    Matrix3.gif
     
  • M21 (Default value 0)

    This is the value at position (2, 1) as in Mathematics. Look at screenshot for more of an explanation.

    Matrix4.gif
     
  • M22 (Default value 1)

    This is the value at position (2, 2) as in Mathematics. M22 is just a point at position (2, 2). If element (here Grid) has the height 50 (look in screenshot below) then it will be considered as 1. If we doubled the value of M22 from 1 to 2 then the transformed size will be about (50x2) 100.

    Matrix5.gif
     
  • OffsetX (Default value 0)

    This is the value at position (3, 1); in the coordinate system it affects the art very little; check yourself by changing its value.
     
  • OffsetY (Default value 0)

    This is the value at position (3, 2); in coordinate system it affects the art very little; check yourself by changing its value.

    Matrix6.gif

In the above screenshot, I have changed the value of every property and using that I get the output shown above.

Be tuned for the next article.

HAVE A HAPPY CODING!!

Up Next
    Ebook Download
    View all
    Learn
    View all