simple C# Matrix manipulation for Silverlight transforms
✓ Published0🌍 Public
RRandomEtc
Last edited Aug 5, 2009
Created on Aug 5, 2009
This example demonstrates a set of C# extension methods for manipulating Silverlight’s `System.Windows.Media.Matrix` structure, enabling chained scale, translation, and rotation operations. The code illustrates how to transform a matrix by passing it through methods like `Scale`, `Translate`, and `Rotate`, which return the modified matrix for fluent composition. It highlights the value-passing semantics of structs in C#, requiring reassignment of the result, while simplifying common transform sequences such as scaling or rotating around a specific point. The implementation relies solely on Silverlight’s matrix API and `System.Math` for trigonometric calculations.
AI-generated description