当前位置: 首页>>代码示例>>C#>>正文


C# Graphics.DrawBeziers方法代码示例

本文整理汇总了C#中System.Drawing.Graphics.DrawBeziers方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics.DrawBeziers方法的具体用法?C# Graphics.DrawBeziers怎么用?C# Graphics.DrawBeziers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Drawing.Graphics的用法示例。


在下文中一共展示了Graphics.DrawBeziers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawBeziersPointF

private void DrawBeziersPointF(PaintEventArgs e)
{
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Create points for curve.
    PointF start = new PointF(100.0F, 100.0F);
    PointF control1 = new PointF(200.0F, 10.0F);
    PointF control2 = new PointF(350.0F, 50.0F);
    PointF end1 = new PointF(500.0F, 100.0F);
    PointF control3 = new PointF(600.0F, 150.0F);
    PointF control4 = new PointF(650.0F, 250.0F);
    PointF end2 = new PointF(500.0F, 300.0F);
    PointF[] bezierPoints = { start, control1, control2, end1,
         control3, control4, end2 };      
                 
    // Draw arc to screen.
    e.Graphics.DrawBeziers(blackPen, bezierPoints);
}
开发者ID:.NET开发者,项目名称:System.Drawing,代码行数:19,代码来源:Graphics.DrawBeziers

示例2: DrawBeziersPoint

private void DrawBeziersPoint(PaintEventArgs e)
{
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Create points for curve.
    Point start = new Point(100, 100);
    Point control1 = new Point(200, 10);
    Point control2 = new Point(350, 50);
    Point end1 = new Point(500, 100);
    Point control3 = new Point(600, 150);
    Point control4 = new Point(650, 250);
    Point end2 = new Point(500, 300);
    Point[] bezierPoints =
             {
                 start, control1, control2, end1,
                 control3, control4, end2
             };
             
    // Draw arc to screen.
    e.Graphics.DrawBeziers(blackPen, bezierPoints);
}
开发者ID:.NET开发者,项目名称:System.Drawing,代码行数:22,代码来源:Graphics.DrawBeziers

示例3: Main

//引入命名空间
using System;
using System.Drawing;
using System.Windows.Forms;
   
class BezierArt: Form
{
   
     public static void Main()
     {
          Application.Run(new BezierArt());
     }
     public BezierArt()
     {
          ResizeRedraw = true; 
     }
     protected override void OnPaint(PaintEventArgs pea)
     {
          DoPage(pea.Graphics, ForeColor,200, 200);
     }       
     protected void DoPage(Graphics grfx, Color clr, int cx, int cy)
     {
          Pen      pen  = new Pen(clr);
          PointF[] aptf = new PointF[4];
   
          int iNum = 100;
 
          for (int i = 0; i < iNum; i++)
          {
               double dAngle = 2 * i * Math.PI / iNum;
   
               aptf[0].X =     cx / 2 + cx /  2 * (float) Math.Cos(dAngle);
               aptf[0].Y = 5 * cy / 8 + cy / 16 * (float) Math.Sin(dAngle);
   
               aptf[1] = new PointF(cx / 2,    -cy);
               aptf[2] = new PointF(cx / 2, 2 * cy);
   
               dAngle += Math.PI;
   
               aptf[3].X = cx / 2 + cx /  4 * (float) Math.Cos(dAngle);
               aptf[3].Y = cy / 2 + cy / 16 * (float) Math.Sin(dAngle);
   
               grfx.DrawBeziers(pen, aptf);
          }
     }
}
开发者ID:C#程序员,项目名称:System.Drawing,代码行数:46,代码来源:Graphics.DrawBeziers


注:本文中的System.Drawing.Graphics.DrawBeziers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。