本文整理汇总了C#中System.Windows.Media.Transform.MultiplyValueByMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.MultiplyValueByMatrix方法的具体用法?C# Transform.MultiplyValueByMatrix怎么用?C# Transform.MultiplyValueByMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Transform
的用法示例。
在下文中一共展示了Transform.MultiplyValueByMatrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Push
/// <summary>
/// Pushes a transformation on the stack. The transformation is multiplied with the top element
/// on the stack and then pushed on the stack.
/// </summary>
/// <param name="transform">2D transformation.</param>
/// <param name="combine">The combine argument indicates if the transform should be pushed multiplied with the
/// current top transform or as is.</param>
/// <remark>
/// The code duplication between Push(ref Matrix, bool) and Push(Transform, bool) is not ideal.
/// However, we did see a performance gain by optimizing the Push(Transform, bool) method
/// minimizing the copies of data.
/// </remark>
public void Push(Transform transform, bool combine)
{
EnsureCapacity();
if (combine && (_size > 0))
{
// Combine means that we push the product of the top matrix and transform
// on the stack. Note that there isn't a top-matrix if the stack is empty.
// In this case the top-matrix is assumed to be identity. See else case.
// _items[_size] is the new top of the stack, _items[_size - 1] is the
// previous top.
transform.MultiplyValueByMatrix(ref _items[_size], ref _items[_size - 1]);
}
else
{
// If we don't combine or if the stack is empty.
_items[_size] = transform.Value;
}
_size++;
// For memory optimization purposes we track the max usage of the stack here.
// See the optimze method for more details about this.
_highWaterMark = Math.Max(_highWaterMark, _size);
}