本文整理汇总了C#中ICanvas.DrawArc方法的典型用法代码示例。如果您正苦于以下问题:C# ICanvas.DrawArc方法的具体用法?C# ICanvas.DrawArc怎么用?C# ICanvas.DrawArc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICanvas
的用法示例。
在下文中一共展示了ICanvas.DrawArc方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(ICanvas canvas, RectangleF unitrect)
{
Color color = Color;
Pen pen = canvas.CreatePen(color, Width);
if (Highlighted || Selected)
{
pen = Canvas.DrawTools.DrawUtils.SelectedPen;
if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
if (m_p2.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p2);
if (m_p3.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p3);
if (m_p4.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p4);
}
canvas.DrawLine(canvas, pen, m_p1, m_p2);
if (m_p3 != m_p4) canvas.DrawLine(canvas, pen, m_p3, m_p4);
pen = new Pen(pen.Color, (float)3);
if (horizontal)
{
canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X+0.2,m_p2.Y));
canvas.DrawLine(canvas, pen, m_p3, new UnitPoint(m_p2.X + 0.8, m_p2.Y));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.61, m_p2.Y), (float)0.19, 0, 360);
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.39, m_p2.Y), (float)0.19, 0, 360);
}
else
{
canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X , m_p2.Y- 0.2));
canvas.DrawLine(canvas, pen, m_p3, new UnitPoint(m_p2.X , m_p2.Y- 0.8));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X , m_p2.Y-0.61), (float)0.19, 0, 360);
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X , m_p2.Y-0.39), (float)0.19, 0, 360);
}
}
示例2: Draw
public override void Draw(ICanvas canvas, RectangleF unitrect)
{
Color color = Color;
Pen pen = canvas.CreatePen(color, Width);
if (Highlighted || Selected)
{
pen = Canvas.DrawTools.DrawUtils.SelectedPen;
}
pen = new Pen(pen.Color, (float)2);
unitrect.Inflate(3, 3);
canvas.DrawArc(canvas,pen,m_p1,(float)0.05,0,360);
canvas.DrawArc(canvas,pen,m_p1,(float)0.08,0,360);
canvas.DrawArc(canvas,pen,m_p1,(float)0.11,0,360);
}
示例3: Draw
public override void Draw(ICanvas canvas, RectangleF unitrect)
{
Color color = Color;
Pen pen = canvas.CreatePen(color, Width);
if (Highlighted || Selected)
{
pen = Canvas.DrawTools.DrawUtils.SelectedPen;
if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
if (m_p2.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p2);
//if ((m_p3.X != m_p2.X + 1 || m_p3.Y != m_p2.Y) && this.horizontal) m_p3 = new UnitPoint(m_p2.X + 1, m_p2.Y);
//if (m_p3.Y != m_p2.Y + 1 && !this.horizontal) m_p3 = new UnitPoint(m_p2.X, m_p2.Y + 1);
if (m_p3.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p3);
}
canvas.DrawLine(canvas, pen, m_p1, m_p2);
pen = new Pen(pen.Color, (float)3);
if (horizontal)
{
canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X + 0.2,m_p2.Y));
canvas.DrawLine(canvas, pen, m_p3, new UnitPoint(m_p2.X + 0.8, m_p2.Y));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.2, m_p2.Y-0.3), new UnitPoint(m_p2.X + 0.8, m_p2.Y+0.3));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.25, m_p2.Y+0.20), new UnitPoint(m_p2.X + 0.55, m_p2.Y+0.20));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.25, m_p2.Y + 0.25), new UnitPoint(m_p2.X + 0.35, m_p2.Y + 0.25));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.45, m_p2.Y + 0.25), new UnitPoint(m_p2.X + 0.55, m_p2.Y + 0.25));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.70, m_p2.Y - 0.2), (float)0.05, 0, 180);
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.60, m_p2.Y - 0.2), (float)0.05, 0, -180);
canvas.Graphics.DrawRectangle(pen, canvas.ToScreen(new UnitPoint(m_p2.X + 0.2,1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y + 0.3)).Y, canvas.ToScreen(new UnitPoint(m_p2.X + 0.8, 11)).X - canvas.ToScreen(new UnitPoint(m_p2.X + 0.2,1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.3)).Y- canvas.ToScreen(new UnitPoint(1, m_p2.Y + 0.3)).Y);
}
else
{
canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X , m_p2.Y- 0.2));
canvas.DrawLine(canvas, pen, m_p3, new UnitPoint(m_p2.X , m_p2.Y- 0.8));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X - 0.3, m_p2.Y - 0.8), new UnitPoint(m_p2.X + 0.3, m_p2.Y - 0.2));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X - 0.25, m_p2.Y - 0.30), new UnitPoint(m_p2.X + 0.05, m_p2.Y- 0.30));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X - 0.25, m_p2.Y - 0.25), new UnitPoint(m_p2.X - 0.15, m_p2.Y - 0.25));
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X - 0.05, m_p2.Y - 0.25), new UnitPoint(m_p2.X + 0.05, m_p2.Y - 0.25));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.20, m_p2.Y - 0.7), (float)0.05, 0, 180);
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.10, m_p2.Y - 0.7), (float)0.05, 0, -180);
canvas.Graphics.DrawRectangle(pen, canvas.ToScreen(new UnitPoint(m_p2.X - 0.3, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.2)).Y, canvas.ToScreen(new UnitPoint(m_p2.X + 0.3, 11)).X - canvas.ToScreen(new UnitPoint(m_p2.X - 0.3, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.8)).Y - canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.2)).Y);
}
}
示例4: Draw
public override void Draw(ICanvas canvas, RectangleF unitrect)
{
Color color = Color;
Pen pen = canvas.CreatePen(color, Width);
if (Highlighted || Selected)
{
pen = Canvas.DrawTools.DrawUtils.SelectedPen;
//if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
}
pen = new Pen(pen.Color, (float)6);
canvas.DrawArc(canvas,pen,m_p1,(float)0.05,0,360);
pen = new Pen(pen.Color, (float)3);
canvas.Graphics.DrawRectangle(pen, canvas.ToScreen(new UnitPoint(m_p1.X - 0.2, m_p1.Y - 0.2)).X, canvas.ToScreen(new UnitPoint(m_p1.X + 0.2, m_p1.Y + 0.2)).Y, canvas.ToScreen(new UnitPoint(m_p1.X + 0.2, m_p1.Y +0.2)).X - canvas.ToScreen(new UnitPoint(m_p1.X - 0.2, m_p1.Y - 0.2)).X, canvas.ToScreen(new UnitPoint(m_p1.X - 0.2, m_p1.Y - 0.2)).Y - canvas.ToScreen(new UnitPoint(m_p1.X + 0.2, m_p1.Y + 0.2)).Y);
}
示例5: Draw
public override void Draw(ICanvas canvas, RectangleF unitrect)
{
Color color = Color;
Pen pen = canvas.CreatePen(color, Width);
if (Highlighted || Selected)
{
pen = Canvas.DrawTools.DrawUtils.SelectedPen;
if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
if (m_p2.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p2);
//if ((m_p3.X != m_p2.X + 1 || m_p3.Y != m_p2.Y) && this.horizontal) m_p3 = new UnitPoint(m_p2.X + 1, m_p2.Y);
//if (m_p3.Y != m_p2.Y + 1 && !this.horizontal) m_p3 = new UnitPoint(m_p2.X, m_p2.Y + 1);
if (m_p3.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p3);
if (m_p4.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p4);
}
canvas.DrawLine(canvas, pen, m_p1, m_p2);
if (m_p4 != m_p3) canvas.DrawLine(canvas, pen, m_p3, m_p4);
pen = new Pen(pen.Color, (float)3);
if (horizontal)
{
canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X + 0.2, m_p2.Y));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.2, m_p2.Y), (float)0.03, 0, 360);
if (isclosed()) canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.2, m_p2.Y), new UnitPoint(m_p2.X + 0.8, m_p2.Y+0.05));
else canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.2, m_p2.Y), new UnitPoint(m_p2.X + 0.8, m_p2.Y + 0.4));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.8, m_p2.Y), (float)0.03, 0, 360);
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.8, m_p2.Y), m_p3);
}
else
{
canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X, m_p2.Y - 0.2));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X, m_p2.Y - 0.2), (float)0.03, 0, 360);
if (isclosed()) canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X, m_p2.Y + 0.2), new UnitPoint(m_p2.X , m_p2.Y- 0.8));
else canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X, m_p2.Y - 0.2), new UnitPoint(m_p2.X + 0.4, m_p2.Y - 0.8));
canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X , m_p2.Y- 0.8), (float)0.03, 0, 360);
canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X, m_p2.Y -0.8), m_p3);
}
}
示例6: Draw
public override void Draw(ICanvas canvas, RectangleF unitrect)
{
Color color = Color;
Brush B = Brushes.Black;
Pen pen = canvas.CreatePen(color, Width);
if (Highlighted || Selected)
{
pen = Canvas.DrawTools.DrawUtils.SelectedPen;
B = Brushes.Magenta;
}
pen = new Pen(pen.Color, (float)6);
canvas.DrawArc(canvas, pen, m_p1, (float)0.03, 0, 360);
float size = (canvas.ToScreen(new UnitPoint(m_p1.X + 1, m_p1.Y)).X - canvas.ToScreen(m_p1).X) / 10;
Font m_font = new System.Drawing.Font("Arial Black", size, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
canvas.Graphics.DrawString("Tp Line Conductor", m_font, B, canvas.ToScreen(new UnitPoint(m_p1.X - 0.4, m_p1.Y + 0.2)).X, canvas.ToScreen(new UnitPoint(m_p1.X - 0.3, m_p1.Y + 0.2)).Y);
}
示例7: Draw
public override void Draw(ICanvas canvas, RectangleF unitrect)
{
Color color = Color;
Pen pen = canvas.CreatePen(color, Width);
if (Highlighted || Selected)
{
pen = Canvas.DrawTools.DrawUtils.SelectedPen;
//if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
}
pen = new Pen(pen.Color, (float)3);
unitrect.Inflate(3, 3);
canvas.DrawArc(canvas,pen,m_p1,(float)0.15,0,360);
canvas.DrawLine(canvas, pen, m_p1, new UnitPoint(m_p1.X, m_p1.Y + 0.12));
canvas.DrawLine(canvas, pen, m_p1, new UnitPoint(m_p1.X+0.08, m_p1.Y - 0.08));
}
示例8: Draw
public virtual void Draw(ICanvas canvas, RectangleF unitrect)
{
float sweep = SweepAngle;
Pen pen = canvas.CreatePen(Color, Width);
canvas.DrawArc(canvas, pen, m_center, m_radius, StartAngle, sweep);
if (Selected)
{
canvas.DrawArc(canvas, DrawUtils.SelectedPen, m_center, m_radius, StartAngle, sweep);
DrawUtils.DrawNode(canvas, m_center);
DrawNodes(canvas);
}
}
示例9: DrawArc
void DrawArc(ICanvas canvas, RectangleF unitrect)
{
Pen pen = canvas.CreatePen(Color, Width);
bool inline = PointsInLine();
double sweep = GetSweep(StartAngle, EndAngle, Direction);
if (inline == false)
canvas.DrawArc(canvas, pen, m_center, m_radius, StartAngle, (float)sweep);
else
{
canvas.DrawLine(canvas, pen, P1, P2);
canvas.DrawLine(canvas, pen, P1, P3);
}
if (Selected)
{
if (inline == false)
canvas.DrawArc(canvas, DrawUtils.SelectedPen, m_center, m_radius, StartAngle, (float)sweep);
else
{
canvas.DrawLine(canvas, DrawUtils.SelectedPen, P1, P2);
canvas.DrawLine(canvas, DrawUtils.SelectedPen, P1, P3);
}
if (m_p1.IsEmpty == false)
{
DrawUtils.DrawNode(canvas, P1);
UnitPoint anglepoint = StartAngleNodePoint(canvas);
if (!anglepoint.IsEmpty)
DrawUtils.DrawTriangleNode(canvas, anglepoint);
anglepoint = EndAngleNodePoint(canvas);
if (!anglepoint.IsEmpty)
DrawUtils.DrawTriangleNode(canvas, anglepoint);
anglepoint = RadiusNodePoint(canvas);
if (!anglepoint.IsEmpty)
DrawUtils.DrawTriangleNode(canvas, anglepoint);
}
if (m_p2.IsEmpty == false)
DrawUtils.DrawNode(canvas, P2);
if (m_p3.IsEmpty == false)
DrawUtils.DrawNode(canvas, P3);
}
}