本文整理汇总了C#中PdfSharp.Drawing.XGraphics.DrawClosedCurve方法的典型用法代码示例。如果您正苦于以下问题:C# XGraphics.DrawClosedCurve方法的具体用法?C# XGraphics.DrawClosedCurve怎么用?C# XGraphics.DrawClosedCurve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfSharp.Drawing.XGraphics
的用法示例。
在下文中一共展示了XGraphics.DrawClosedCurve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderClosedCurves
void RenderClosedCurves(XGraphics gfx)
{
gfx.TranslateTransform(15, 20);
XPen pen = new XPen(XColors.DarkBlue, 2.5);
gfx.DrawClosedCurve(pen, XBrushes.SkyBlue,
new XPoint[] { new XPoint(10, 120), new XPoint(80, 30), new XPoint(220, 20), new XPoint(170, 110), new XPoint(100, 90) },
XFillMode.Winding, 0.7);
}
示例2: RenderPage
/// <summary>
/// Demonstrates the use of XGraphics.DrawClosedCurve.
/// </summary>
public override void RenderPage(XGraphics gfx)
{
base.RenderPage(gfx);
XPoint[] points = new XPoint[]
{
new XPoint(50, 100),
new XPoint(450, 120),
new XPoint(550, 300),
//new XPoint(150, 380),
};
gfx.DrawClosedCurve(properties.Pen2.Pen, properties.Brush1.Brush, points,
properties.General.FillMode, properties.General.Tension);
}
示例3: RenderPage
/// <summary>
/// Source and more infos: http://www.math.dartmouth.edu/~dlittle/java/SpiroGraph/
/// </summary>
public override void RenderPage(XGraphics gfx)
{
base.RenderPage(gfx);
//int R = 60, r = 60, p = 60, N = 270; // Cardioid
//int R = 60, r = -45, p = -101, N = 270; // Rounded Square
//int R = 75, r = -25, p = 85, N = 270; // Gold fish
//int R = 75, r = -30, p = 60, N = 270; // Star fish
//int R = 100, r = 49, p = 66, N = 7; // String of Pearls
//int R = 90, r = 1, p = 105, N = 105; // Rotating Triangle
//int R = 90, r = 1, p = 105, N = 105;
int R = 60, r = 2, p = 122, N = 490;
int revs = Math.Abs(r) / Gcd(R, Math.Abs(r));
XPoint[] points = new XPoint[revs * N + 1];
for (int i = 0; i <= revs * N; i++)
{
double t = 4 * i * Math.PI / N;
points[i].X = ((R+r)*Math.Cos(t) - p * Math.Cos((R+r)* t / r));
points[i].Y = ((R+r)*Math.Sin(t) - p * Math.Sin((R+r)* t / r));
}
#if true
// Draw as lines
gfx.TranslateTransform(300, 250);
gfx.DrawLines(properties.Pen2.Pen, points);
//gfx.DrawPolygon(properties.Pen2.Pen, properties.Brush2.Brush, points, properties.General.FillMode);
// Draw as closed curve
gfx.TranslateTransform(0, 400);
gfx.DrawClosedCurve(properties.Pen2.Pen, properties.Brush2.Brush, points, properties.General.FillMode,
properties.General.Tension);
#else
gfx.TranslateTransform(300, 400);
XSolidBrush dotBrush = new XSolidBrush(properties.Pen2.Pen.Color);
float width = properties.Pen2.Width;
for (int i = 0; i < revs * N; i++)
gfx.DrawEllipse(dotBrush,points[i].X, points[i].Y, width, width);
#endif
}
示例4: DrawClosedCurve
/// <summary>
/// Draws a closed cardinal spline.
/// </summary>
void DrawClosedCurve(XGraphics gfx, int number)
{
BeginBox(gfx, number, "DrawClosedCurve");
XPen pen = new XPen(XColors.DarkBlue, 2.5);
gfx.DrawClosedCurve(pen, XBrushes.SkyBlue,
new XPoint[] { new XPoint(10, 120), new XPoint(80, 30), new XPoint(220, 20), new XPoint(170, 110), new XPoint(100, 90) },
XFillMode.Winding, 0.7);
EndBox(gfx);
}