本文整理汇总了C#中PdfSharp.Drawing.XGraphics.DrawBezier方法的典型用法代码示例。如果您正苦于以下问题:C# XGraphics.DrawBezier方法的具体用法?C# XGraphics.DrawBezier怎么用?C# XGraphics.DrawBezier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfSharp.Drawing.XGraphics
的用法示例。
在下文中一共展示了XGraphics.DrawBezier方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderPage
/// <summary>
/// Demonstrates the use of XGraphics.DrawBezier.
/// </summary>
public override void RenderPage(XGraphics gfx)
{
base.RenderPage(gfx);
gfx.DrawEllipse(XBrushes.Red, MakeRect(50, 100));
gfx.DrawEllipse(XBrushes.Red, MakeRect(450, 100));
gfx.DrawEllipse(XBrushes.Red, MakeRect(550, 190));
gfx.DrawEllipse(XBrushes.Red, MakeRect(150, 300));
gfx.DrawLine(XPens.Red, 50, 100, 450, 100);
gfx.DrawLine(XPens.Red, 550, 190, 150, 300);
gfx.DrawBezier(properties.Pen2.Pen, 50, 100, 450, 100, 550, 190, 150, 300);
//XPoint[] points = new XPoint[1 + 3 * 3];
//Random rnd = new Random();
//for (int idx = 0; idx < points.Length; idx++)
//{
// points[idx].X = 100 + rnd.Next(400);
// points[idx].Y = 200 + rnd.Next(700);
//}
//gfx.DrawBeziers(properties.Pen1.Pen, points);
}
示例2: DrawBezier
/// <summary>
/// Draws a single Bézier curve.
/// </summary>
void DrawBezier(XGraphics gfx, int number)
{
BeginBox(gfx, number, "DrawBezier");
gfx.DrawBezier(new XPen(XColors.DarkRed, 5), 20, 110, 40, 10, 170, 90, 230, 20);
EndBox(gfx);
}
示例3: DrawQuadraticBezier
private void DrawQuadraticBezier(XGraphics gfx, IQuadraticBezier quadraticBezier)
{
double x1 = quadraticBezier.Start.X;
double y1 = quadraticBezier.Start.Y;
double x2 = quadraticBezier.Start.X + (2.0 * (quadraticBezier.Point1.X - quadraticBezier.Start.X)) / 3.0;
double y2 = quadraticBezier.Start.Y + (2.0 * (quadraticBezier.Point1.Y - quadraticBezier.Start.Y)) / 3.0;
double x3 = x2 + (quadraticBezier.Point2.X - quadraticBezier.Start.X) / 3.0;
double y3 = y2 + (quadraticBezier.Point2.Y - quadraticBezier.Start.Y) / 3.0;
double x4 = quadraticBezier.Point2.X;
double y4 = quadraticBezier.Point2.Y;
var pen = new XPen(
ToXColor(quadraticBezier.Stroke),
X(quadraticBezier.StrokeThickness));
gfx.DrawBezier(pen,
X(x1), Y(y1),
X(x2), Y(y2),
X(x3), Y(y3),
X(x4), Y(y4));
}
示例4: DrawBezier
private void DrawBezier(XGraphics gfx, IBezier bezier)
{
var pen = new XPen(
ToXColor(bezier.Stroke),
X(bezier.StrokeThickness));
gfx.DrawBezier(pen,
X(bezier.Start.X), Y(bezier.Start.Y),
X(bezier.Point1.X), Y(bezier.Point1.Y),
X(bezier.Point2.X), Y(bezier.Point2.Y),
X(bezier.Point3.X), Y(bezier.Point3.Y));
}