Learn Silverlight 2 series (30): Use transform to achieve a more dazzling effect (bottom)

Source: Internet
Author: User
Tags silverlight

This article is to achieve a more dazzling effect using transform. The second part provides four basic transformations in Silverlight: Rotational Transformations (rotatetransform), scaling Transformations (ScaleTransform), Skew Transformations (SkewTransform), moving Transformations (TranslateTransform), and two complex transformations: Transform groups (TransformGroup), Matrix Transformations (MatrixTransform), these transformations can be applied to any control or graphic image.

Matrix transform (MatrixTransform)

Matrix Transform MatrixTransform is one of the most powerful and flexible transformations in all transformations, and if the basic changes explained above do not meet our actual development needs, we can customize it by using matrix transformation, which allows us to manipulate the transformation matrix directly.

In Silverlight, a transform is a matrix that provides a 3*3, we implement transformations by modifying the values of the members in the matrix, and the definition of the matrix is as follows:

If you modify OffsetX, the elements will move on the x-axis, modify the offsety, the elements will move on the y-axis, modify the M22 to 2, and the height of the element will stretch twice times, through which we can implement all the functions of the basic transformations mentioned earlier. For more detailed explanation you can refer to the SDK. As in the following example, we can still implement the transform effect in the previous example by using a matrix transform:

<canvas background= "#CDFCAE" >
<image source= "A1.png" canvas.left= "canvas.top=" opacity= "0.3" >
</Image>
<image source= "A1.png" canvas.left= "canvas.top=" opacity= "0.5" >
<Image.RenderTransform>
<MatrixTransform>
<MatrixTransform.Matrix>
<matrix offsetx= "0" offsety= "0" m12= "0.2" ></Matrix>
</MatrixTransform.Matrix>
</MatrixTransform>
</Image.RenderTransform>
</Image>
  
<image source= "A1.png" canvas.left= "canvas.top=" >
<Image.RenderTransform>
<MatrixTransform>
<MatrixTransform.Matrix>
<matrix offsetx= "0" offsety= "0" m12= "0.4" ></Matrix>
</MatrixTransform.Matrix>
</MatrixTransform>
</Image.RenderTransform>
</Image>
</Canvas>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.