本文整理汇总了C#中LilyPath.Pen类的典型用法代码示例。如果您正苦于以下问题:C# Pen类的具体用法?C# Pen怎么用?C# Pen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pen类属于LilyPath命名空间,在下文中一共展示了Pen类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GradientPensAlignment
public GradientPensAlignment()
{
_gradWidthInner = new GradientPen(Microsoft.Xna.Framework.Color.Lime, Microsoft.Xna.Framework.Color.Cyan, 15) { Alignment = PenAlignment.Inset, StartCap = LineCap.Square, EndCap = LineCap.Square };
_gradWidthCenter = new GradientPen(Microsoft.Xna.Framework.Color.Lime, Microsoft.Xna.Framework.Color.Cyan, 15) { StartCap = LineCap.Square, EndCap = LineCap.Square };
_gradWidthOuter = new GradientPen(Microsoft.Xna.Framework.Color.Lime, Microsoft.Xna.Framework.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 (CCVector2 v in _baseCoords)
builder.AddPoint(v + Offset(i));
_gPaths[i] = builder.Stroke(pens[i]);
}
}
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:15,代码来源:GradientPensAlignment.cs
示例17: Setup
public override void Setup (GraphicsDevice device)
{
_bluePen = new Pen(Color.Blue, 15);
_pointPen = new Pen(Color.Gray, 4);
_wavePoints = new Vector2[] {
new Vector2(50, 350), new Vector2(50, 400), new Vector2(150, 400), new Vector2(150, 350), new Vector2(150, 300),
new Vector2(250, 300), new Vector2(250, 350), new Vector2(250, 400), new Vector2(350, 400), new Vector2(350, 350),
new Vector2(350, 300), new Vector2(450, 300), new Vector2(450, 350),
};
_loopPoints = new Vector2[] {
new Vector2(225, 75), new Vector2(250, 50), new Vector2(275, 50), new Vector2(300, 75),
new Vector2(325, 100), new Vector2(325, 125), new Vector2(300, 150), new Vector2(275, 175),
new Vector2(250, 175), new Vector2(225, 150), new Vector2(200, 125), new Vector2(200, 100),
};
}
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:17,代码来源:CubicBezier.cs
示例18: CubicBezier
public CubicBezier()
{
_bluePen = new Pen(Microsoft.Xna.Framework.Color.Blue, 15);
_pointPen = new Pen(Microsoft.Xna.Framework.Color.Gray, 4);
_wavePoints = new CCVector2[] {
new CCVector2(50, 350), new CCVector2(50, 400), new CCVector2(150, 400), new CCVector2(150, 350), new CCVector2(150, 300),
new CCVector2(250, 300), new CCVector2(250, 350), new CCVector2(250, 400), new CCVector2(350, 400), new CCVector2(350, 350),
new CCVector2(350, 300), new CCVector2(450, 300), new CCVector2(450, 350),
};
_loopPoints = new CCVector2[] {
new CCVector2(225, 75), new CCVector2(250, 50), new CCVector2(275, 50), new CCVector2(300, 75),
new CCVector2(325, 100), new CCVector2(325, 125), new CCVector2(300, 150), new CCVector2(275, 175),
new CCVector2(250, 175), new CCVector2(225, 150), new CCVector2(200, 125), new CCVector2(200, 100),
};
}
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:18,代码来源:CubicBezier.cs
示例19: Setup
public override void Setup (GraphicsDevice device)
{
_starPoints1 = StarPoints(new Vector2(125, 150), 5, 100, 50, 0, false);
_starPoints2 = StarPoints(new Vector2(350, 275), 5, 100, 50, 0, false);
_starPoints3 = StarPoints(new Vector2(125, 400), 5, 100, 50, 0, false);
_insetPen = new Pen(Color.MediumTurquoise, 10) {
Alignment = PenAlignment.Inset
};
_centerPen = new Pen(Color.MediumTurquoise, 10) {
Alignment = PenAlignment.Center
};
_outsetPen = new Pen(Color.MediumTurquoise, 10) {
Alignment = PenAlignment.Outset
};
_insetPath = new GraphicsPath(_insetPen, _starPoints1, PathType.Closed);
_centerPath = new GraphicsPath(_centerPen, _starPoints2, PathType.Closed);
_outsetPath = new GraphicsPath(_outsetPen, _starPoints3, PathType.Closed);
}
开发者ID:Luckyknight1,项目名称:LilyPath,代码行数:20,代码来源:PenAlignment.cs
示例20: QuadraticBezier
public QuadraticBezier()
{
_bluePen = new Pen(Microsoft.Xna.Framework.Color.Blue, 15);
_pointPen = new Pen(Microsoft.Xna.Framework.Color.Gray, 4);
_wavePoints1 = new CCVector2[] {
new CCVector2(150, 100), new CCVector2(200, 150), new CCVector2(250, 100), new CCVector2(300, 50), new CCVector2(350, 100),
new CCVector2(400, 150), new CCVector2(450, 100), new CCVector2(500, 50), new CCVector2(550, 100),
};
_wavePoints2 = new CCVector2[] {
new CCVector2(150, 200), new CCVector2(200, 300), new CCVector2(250, 200), new CCVector2(300, 100), new CCVector2(350, 200),
new CCVector2(400, 300), new CCVector2(450, 200), new CCVector2(500, 100), new CCVector2(550, 200),
};
_loopPoints = new CCVector2[] {
new CCVector2(250, 300), new CCVector2(350, 300), new CCVector2(350, 400), new CCVector2(350, 500),
new CCVector2(250, 500), new CCVector2(150, 500), new CCVector2(150, 400), new CCVector2(150, 300),
};
}
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:20,代码来源:QuadraticBezier.cs
注:本文中的LilyPath.Pen类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论