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


C# LilyPath.Pen类代码示例

本文整理汇总了C#中LilyPath.Pen的典型用法代码示例。如果您正苦于以下问题:C# Pen类的具体用法?C# Pen怎么用?C# Pen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Pen类属于LilyPath命名空间,在下文中一共展示了Pen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GraphicsPathTest

        public GraphicsPathTest()
        {
            _thickPen = new Pen(Microsoft.Xna.Framework.Color.Green, 15);

            List<CCVector2> path1 = new List<CCVector2>() {
                new CCVector2(50, 50), new CCVector2(100, 50), new CCVector2(100, 100), new CCVector2(50, 100),
            };

            _gpathf = new GraphicsPath(_thickPen, path1, PathType.Closed);

            path1.Reverse();
            for (int i = 0; i < path1.Count; i++)
                path1[i] = new CCVector2(path1[i].X + 100, path1[i].Y);

            _gpathr = new GraphicsPath(_thickPen, path1, PathType.Closed);

            for (int i = 0; i < path1.Count; i++)
                path1[i] = new CCVector2(path1[i].X, path1[i].Y + 100);

            _gpath2r = new GraphicsPath(_thickPen, path1);

            path1.Reverse();
            for (int i = 0; i < path1.Count; i++)
                path1[i] = new CCVector2(path1[i].X - 100, path1[i].Y);

            _gpath2f = new GraphicsPath(_thickPen, path1);
        }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:27,代码来源:GraphicsPathTest.cs

示例2: InitializePaths

        private void InitializePaths()
        {
            var bounds = VisibleBoundsWorldspace;
            var center = bounds.Center;
            //var center = new CCVector2(200, 200);

            Pen lilypadPen = new Pen(CCColor4B.Green, 15)
            {
                Alignment = PenAlignment.Center
            };

            _lilypadPath = BuildLillyPad(center, 150, 0);
            _lilypadStroke = _lilypadPath.Stroke(lilypadPen, PathType.Closed);

            Pen outerFlowerPen = new Pen(CCColor4B.White * 0.75f, 15)
            {
                Alignment = PenAlignment.Outset
            };

            _outerFlowerStroke = BuildFlower(center, 8, 120, 100, (float)(Math.PI / 8)).Stroke(outerFlowerPen, PathType.Closed);

            Pen innerFlowerPen = new Pen(Microsoft.Xna.Framework.Color.MediumPurple * 0.5f, 10)
            {
                Alignment = PenAlignment.Outset
            };

            _innerFlowerStroke = BuildFlower(center, 16, 105, 60, 0).Stroke(innerFlowerPen, PathType.Closed);
        }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:28,代码来源:IntroLayer.cs

示例3: Setup

        public override void Setup (GraphicsDevice device)
        {
            _thickPen = new Pen(Color.Green, 15);

            List<Vector2> path1 = new List<Vector2>() {
                new Vector2(50, 50), new Vector2(100, 50), new Vector2(100, 100), new Vector2(50, 100),
            };

            _gpathf = new GraphicsPath(_thickPen, path1, PathType.Closed);

            path1.Reverse();
            for (int i = 0; i < path1.Count; i++)
                path1[i] = new Vector2(path1[i].X + 100, path1[i].Y);

            _gpathr = new GraphicsPath(_thickPen, path1, PathType.Closed);

            for (int i = 0; i < path1.Count; i++)
                path1[i] = new Vector2(path1[i].X, path1[i].Y + 100);

            _gpath2r = new GraphicsPath(_thickPen, path1);

            path1.Reverse();
            for (int i = 0; i < path1.Count; i++)
                path1[i] = new Vector2(path1[i].X - 100, path1[i].Y);

            _gpath2f = new GraphicsPath(_thickPen, path1);
        }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:27,代码来源:GraphicsPath.cs

示例4: DisposeManaged

        protected override void DisposeManaged()
        {
            if (_data != null) {
                _data.FillInvalidated -= HandleFillInvalidated;
                _data.FillGlowInvalidated -= HandleFillGlowInvalidated;
                _data.OutlineInvalidated -= HandleOutlineInvalidated;
                _data.OutlineGlowInvalidated -= HandleOutlineGlowInvalidated;
                _data = null;
            }

            if (_fillBrush != null) {
                _fillBrush.Dispose();
                _fillBrush = null;
            }

            if (_fillGlowBrush != null) {
                _fillGlowBrush.Dispose();
                _fillGlowBrush = null;
            }

            if (_outlinePen != null) {
                _outlinePen.Dispose();
                _outlinePen = null;
            }

            if (_outlineGlowPen != null) {
                _outlineGlowPen.Dispose();
                _outlineGlowPen = null;
            }

            base.DisposeManaged();
        }
开发者ID:JuliaABurch,项目名称:Treefrog,代码行数:32,代码来源:DrawAnnotationRenderer.cs

示例5: Setup

 public override void Setup (GraphicsDevice device)
 {
     _flatPen = new Pen(Color.Blue, 15) { StartCap = LineCap.Flat, EndCap = LineCap.Flat };
     _squarePen = new Pen(Color.Red, 15) { StartCap = LineCap.Square, EndCap = LineCap.Square };
     _trianglePen = new Pen(Color.Green, 15) { StartCap = LineCap.Triangle, EndCap = LineCap.Triangle };
     _invTrianglePen = new Pen(Color.Purple, 15) { StartCap = LineCap.InvTriangle, EndCap = LineCap.InvTriangle };
     _arrowPen = new Pen(Color.Orange, 15) { StartCap = LineCap.Arrow, EndCap = LineCap.Arrow };
 }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:8,代码来源:LineCaps.cs

示例6: WaterLilly

        public WaterLilly()
        {
            Pen penOuterFlower = new Pen(Microsoft.Xna.Framework.Color.White * 0.75f, 15) { Alignment = PenAlignment.Outset };
            _lilyOuterFlower = CreateFlowerGP(penOuterFlower, _origin, 8, 120, 100, (float)(Math.PI / 8));

            Pen penInnerFlower = new Pen(Microsoft.Xna.Framework.Color.MediumPurple * 0.5f, 10) { Alignment = PenAlignment.Outset };
            _lilyInnerFlower = CreateFlowerGP(penInnerFlower, _origin, 16, 105, 60, 0);
        }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:8,代码来源:WaterLilly.cs

示例7: Setup

        public override void Setup (GraphicsDevice device)
        {
            Pen penOuterFlower = new Pen(Color.White * 0.75f, 15) { Alignment = PenAlignment.Outset };
            _lilyOuterFlower = CreateFlowerGP(penOuterFlower, _origin, 8, 120, 100, (float)(Math.PI / 8));

            Pen penInnerFlower = new Pen(Color.MediumPurple * 0.5f, 10) { Alignment = PenAlignment.Outset };
            _lilyInnerFlower = CreateFlowerGP(penInnerFlower, _origin, 16, 105, 60, 0);
        }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:8,代码来源:WaterLilly.cs

示例8: LineCaps

        public LineCaps()
        {

            _flatPen = new Pen(Microsoft.Xna.Framework.Color.Blue, 15) { StartCap = LineCap.Flat, EndCap = LineCap.Flat };
            _squarePen = new Pen(Microsoft.Xna.Framework.Color.Red, 15) { StartCap = LineCap.Square, EndCap = LineCap.Square };
            _trianglePen = new Pen(Microsoft.Xna.Framework.Color.Green, 15) { StartCap = LineCap.Triangle, EndCap = LineCap.Triangle };
            _invTrianglePen = new Pen(Microsoft.Xna.Framework.Color.Purple, 15) { StartCap = LineCap.InvTriangle, EndCap = LineCap.InvTriangle };
            _arrowPen = new Pen(Microsoft.Xna.Framework.Color.Orange, 15) { StartCap = LineCap.Arrow, EndCap = LineCap.Arrow };
        }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:9,代码来源:LineCaps.cs

示例9: Setup

        public override void Setup (GraphicsDevice device)
        {
            _gradWidth = new GradientPen(Color.Lime, Color.Blue, 15);
            _gradLength = new PathGradientPen(Color.Lime, Color.Blue, 15);

            PathBuilder pathBuilder = new PathBuilder() { CalculateLengths = true };
            pathBuilder.AddPath(StarPoints(new Vector2(325, 75), 5, 50, 25, 0, false));

            _widthStar = pathBuilder.Stroke(_gradWidth, PathType.Open);
            _lengthStar = pathBuilder.Stroke(_gradLength, Matrix.CreateTranslation(0, 125, 0), PathType.Open);
        }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:11,代码来源:GradientPens.cs

示例10: Initialize

            public void Initialize (Rectangle bounds, float mag)
            {
                ColorPen = new Pen(new Color(rand.Next(255), rand.Next(255), rand.Next(255)));

                for (int i = 0; i < Points.Length; i++) {
                    Points[i] = new Vector2(bounds.Left + (float)rand.NextDouble() * bounds.Width, bounds.Top + (float)rand.NextDouble() * bounds.Height);
                    Velocities[i] = new Vector2((float)(rand.NextDouble() - .5) * mag, (float)(rand.NextDouble() - .5) * mag);

                    for (int j = 0; j < History.Count; j++)
                        History[j][i] = Points[i];
                }
            }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:12,代码来源:Mystify.cs

示例11: Initialize

            public void Initialize(CCRect bounds, float mag)
            {
                ColorPen = new Pen(new Microsoft.Xna.Framework.Color(rand.Next(255), rand.Next(255), rand.Next(255)));

                for (int i = 0; i < Points.Length; i++)
                {
                    Points[i] = new CCVector2(bounds.MinX + (float)rand.NextDouble() * bounds.Size.Width, bounds.MaxY + (float)rand.NextDouble() * bounds.Size.Height);
                    Velocities[i] = new CCVector2((float)(rand.NextDouble() - .5) * mag, (float)(rand.NextDouble() - .5) * mag);

                    for (int j = 0; j < History.Count; j++)
                        History[j][i] = Points[i];
                }
            }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:13,代码来源:Mystify.cs

示例12: CreateFlowerGP

        private GraphicsPath CreateFlowerGP (Pen pen, Vector2 center, int petalCount, float petalLength, float petalWidth, float rotation)
        {
            List<Vector2> points = StarPoints(center, petalCount / 2, petalLength, petalLength, rotation, false);

            PathBuilder builder = new PathBuilder();
            builder.AddPoint(center);

            foreach (Vector2 point in points) {
                builder.AddArcByPoint(point, petalWidth / 2);
                builder.AddArcByPoint(center, petalWidth / 2);
            }

            return builder.Stroke(pen, PathType.Closed);
        }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:14,代码来源:WaterLilly.cs

示例13: GradientPens

        public GradientPens()
        {

            _gradWidth = new GradientPen(Microsoft.Xna.Framework.Color.Lime, Microsoft.Xna.Framework.Color.Blue, 15);
            _gradLength = new PathGradientPen(Microsoft.Xna.Framework.Color.Lime, Microsoft.Xna.Framework.Color.Blue, 15);

            PathBuilder pathBuilder = new PathBuilder() { CalculateLengths = true };
            pathBuilder.AddPath(StarPoints(new CCVector2(325, 75), 5, 50, 25, 0, false));

            _widthStar = pathBuilder.Stroke(_gradWidth, PathType.Open);
            _lengthStar = pathBuilder.Stroke(_gradLength, 
                CCAffineTransform.Translate(CCAffineTransform.Identity, 0, 125, 0), 
                PathType.Open);
        }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:14,代码来源:GradientPens.cs

示例14: OnEnter

        public override void OnEnter()
        {
            var penWidth = 6.0f;
            Pen pen = new Pen(new Microsoft.Xna.Framework.Color(Microsoft.Xna.Framework.Color.Blue, 92), penWidth);

            var bounds = VisibleBoundsWorldspace;
            var size = bounds.Size;
            var width = size.Width - penWidth;
            var height = size.Height - penWidth;
            //_cache = new Grid(12, 10).Compile(pen, 3, 3, 30 * 12, 30 * 10);
            _cache = new Grid(12, 10).Compile(pen, penWidth/2, penWidth/2, width, height);

            base.OnEnter();
        }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:14,代码来源:GridShape.cs

示例15: Setup

        public override void Setup (GraphicsDevice device)
        {
            _gradWidthInner = new GradientPen(Color.Lime, Color.Cyan, 15) { Alignment = PenAlignment.Inset, StartCap = LineCap.Square, EndCap = LineCap.Square };
            _gradWidthCenter = new GradientPen(Color.Lime, Color.Cyan, 15) { StartCap = LineCap.Square, EndCap = LineCap.Square };
            _gradWidthOuter = new GradientPen(Color.Lime, Color.Cyan, 15) { Alignment = PenAlignment.Outset, StartCap = LineCap.Square, EndCap = LineCap.Square };

            Pen[] pens = new Pen[] { _gradWidthInner, _gradWidthCenter, _gradWidthOuter };
            for (int i = 0; i < _gPaths.Length; i++) {
                PathBuilder builder = new PathBuilder();
                foreach (Vector2 v in _baseCoords)
                    builder.AddPoint(v + Offset(i));
                _gPaths[i] = builder.Stroke(pens[i]);
            }
        }
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:14,代码来源:GradientPensAlignment.cs


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