當前位置: 首頁>>代碼示例>>C#>>正文


C# XGraphics.DrawBezier方法代碼示例

本文整理匯總了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);
    }
開發者ID:vronikp,項目名稱:EventRegistration,代碼行數:26,代碼來源:LinesBezierCurve.cs

示例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);
    }
開發者ID:bossaia,項目名稱:alexandrialibrary,代碼行數:11,代碼來源:LinesAndCurves.cs

示例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));
        }
開發者ID:monocraft,項目名稱:RxCanvas,代碼行數:21,代碼來源:PdfCreator.cs

示例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));
        }
開發者ID:monocraft,項目名稱:RxCanvas,代碼行數:12,代碼來源:PdfCreator.cs


注:本文中的PdfSharp.Drawing.XGraphics.DrawBezier方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。