本文整理匯總了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));
}