当前位置: 首页>>代码示例>>C#>>正文


C# Transform.MultiplyValueByMatrix方法代码示例

本文整理汇总了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);            
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:37,代码来源:MatrixStack.cs


注:本文中的System.Windows.Media.Transform.MultiplyValueByMatrix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。