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


C# Buffer.SetNext方法代码示例

本文整理汇总了C#中System.Buffer.SetNext方法的典型用法代码示例。如果您正苦于以下问题:C# Buffer.SetNext方法的具体用法?C# Buffer.SetNext怎么用?C# Buffer.SetNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Buffer的用法示例。


在下文中一共展示了Buffer.SetNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddJoint

        private int AddJoint (int pointIndex, ref JoinSample joinSample, PenWorkspace ws, Buffer<Vector2> insetBuffer, Buffer<Vector2> outsetBuffer)
        {
            InsetOutsetCount vioCount = new InsetOutsetCount();

            switch (_pen.LineJoin) {
                case LineJoin.Miter:
                    vioCount = _pen.ComputeMiter(ref joinSample, ws);
                    break;
                case LineJoin.Bevel:
                    vioCount = _pen.ComputeBevel(ref joinSample, ws);
                    break;
            }

            if (insetBuffer != null) {
                for (int i = 0; i < vioCount.InsetCount; i++)
                    insetBuffer.SetNext(ws.XYInsetBuffer[i]);
            }
            if (outsetBuffer != null) {
                for (int i = 0; i < vioCount.OutsetCount; i++)
                    outsetBuffer.SetNext(ws.XYOutsetBuffer[i]);
            }

            return (_strokeType != StrokeType.Outline) ? AddJoint(pointIndex, vioCount, ws) : 0;
        }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:24,代码来源:GraphicsPath.cs

示例2: AddStartOrEndPoint

        private int AddStartOrEndPoint (int pointIndex, PenWorkspace ws, Buffer<Vector2> positionBuffer, bool ccw)
        {
            int xyCount = ws.XYBuffer.Index;

            if (positionBuffer != null) {
                for (int i = 0; i < ws.OutlineIndexBuffer.Index; i++)
                    positionBuffer.SetNext(ws.XYBuffer[ws.OutlineIndexBuffer[i]]);
            }

            if (_strokeType == StrokeType.Outline)
                return 0;

            int baseIndex = _vertexBufferIndex;

            _vertexBufferIndex += xyCount;

            for (int i = 0; i < xyCount; i++)
                _positionData[baseIndex + i] = ws.XYBuffer[i];

            for (int i = 0; i < ws.IndexBuffer.Index; i++)
                _indexData[_indexBufferIndex++] = (short)(baseIndex + ws.IndexBuffer[i]);

            if (_colorData != null) {
                for (int i = 0; i < xyCount; i++)
                    _colorData[baseIndex + i] = _pen.ColorAt(ws.UVBuffer[i], ws.PathLengthScale);
            }

            if (_textureData != null) {
                int texWidth = _pen.Brush.Texture.Width;
                int texHeight = _pen.Brush.Texture.Height;

                for (int i = baseIndex; i < _vertexBufferIndex; i++) {
                    Vector2 pos = _positionData[i];
                    _textureData[i] = new Vector2(pos.X / texWidth, pos.Y / texHeight);
                }
            }

            _jointCCW[pointIndex] = ccw;

            return xyCount;
        }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:41,代码来源:GraphicsPath.cs


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