本文整理汇总了C#中System.FillEllipse方法的典型用法代码示例。如果您正苦于以下问题:C# System.FillEllipse方法的具体用法?C# System.FillEllipse怎么用?C# System.FillEllipse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System.FillEllipse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawPoint
public static void DrawPoint(System.Drawing.Graphics g, PointType type, Color c, float w, float x, float y)
{
w = w/2;
switch (type)
{
case PointType.TriangleUp:
var triangleUp = new[]
{
new PointF(x - w, y + w),
new PointF(x + w, y + w),
new PointF(x, y - w)
};
g.FillPolygon(new SolidBrush(c), triangleUp);
g.DrawPolygon(new Pen(Color.Black, 1), triangleUp);
break;
case PointType.TriangleDown:
var triangleDown = new[]
{
new PointF(x - w, y - w),
new PointF(x + w, y - w),
new PointF(x, y + w)
};
g.FillPolygon(new SolidBrush(c), triangleDown);
g.DrawPolygon(new Pen(Color.Black, 1), triangleDown);
break;
case PointType.Circle:
g.FillEllipse(new SolidBrush(c), x - w, y - w, 2 * w, 2 * w);
g.DrawEllipse(new Pen(Color.Black, 1), x - w, y - w, 2 * w, 2 * w);
break;
case PointType.Square:
g.FillRectangle(new SolidBrush(c), x - w, y - w, 2 * w, 2 * w);
g.DrawRectangle(new Pen(Color.Black, 1), x - w, y - w, 2 * w, 2 * w);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
示例2: Draw
public override void Draw(System.Drawing.Graphics gr)
{
Brush brush = new SolidBrush(Color.Blue);
PointF pos = Position;
gr.FillEllipse(brush, pos.X -radius, pos.Y - radius, 2*radius, 2*radius);
}
示例3: Draw
public override void Draw(System.Drawing.Graphics gr)
{
Brush brush = new SolidBrush(Color);
PointF pos = GlobalPos;
gr.FillEllipse(brush, pos.X - Radius, pos.Y - Radius, 2 * Radius, 2 * Radius);
}
示例4: draw
public override void draw(System.Drawing.Graphics g)
{
if (active)
{
g.FillEllipse(Brushes.Black, xCoord - 2f, yCoord - 2f, 4f, 4f);
}
}
示例5: Draw
public override void Draw(System.Drawing.Graphics g)
{
GraphicsState gs = g.Save();
PointF[] transformedPoints = this.getScreenBoundsInWorldCoordinates(g);
g.DrawLine(axisPen, new PointF(base.Position.X, transformedPoints[0].Y), new PointF(base.Position.X, transformedPoints[1].Y));
g.DrawLine(axisPen, new PointF(transformedPoints[0].X, base.Position.Y), new PointF(transformedPoints[1].X, base.Position.Y));
#if DEBUG
g.FillEllipse(Brushes.Maroon, base.Position.X, transformedPoints[0].Y, 10, 10);
g.FillEllipse(Brushes.Maroon, base.Position.X, transformedPoints[1].Y, -10, -10);
g.FillEllipse(Brushes.Maroon, transformedPoints[0].X, base.Position.Y, 10, 10);
g.FillEllipse(Brushes.Maroon, transformedPoints[1].X, base.Position.Y, -10, -10);
#endif
g.Restore(gs);
}
示例6: Paint
protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
{
try
{
string text = value == null ? "" : (string)value;
Brush backColorBrush = new SolidBrush(cellStyle.BackColor);
Brush foreColorBrush = new SolidBrush(cellStyle.ForeColor);
var col = this.OwningColumn as DataGridViewColorMarkColumn;
Color markcolor = cellStyle.ForeColor;
bool hasmark = col.GetColorMark(rowIndex, out markcolor);
Brush markColorBrush = new SolidBrush(markcolor);
base.Paint(g, clipBounds, cellBounds,
rowIndex, cellState, value, formattedValue, errorText,
cellStyle, advancedBorderStyle, (paintParts & ~DataGridViewPaintParts.ContentForeground));
int rsz = this.DataGridView.RowTemplate.Height - 8;
int dy = (cellBounds.Height - this.DataGridView.RowTemplate.Height) / 2;
g.FillEllipse(markColorBrush, cellBounds.X + 2, cellBounds.Y + 4 + dy, rsz, rsz);
//g.FillRectangle(markColorBrush, cellBounds.X + 2, cellBounds.Y + 4, rsz, rsz);
g.DrawString(text, cellStyle.Font, foreColorBrush, cellBounds.X + 4 + rsz, cellBounds.Y + 2 + dy);
}
catch (Exception e) { }
}
示例7: OnPaint
protected override void OnPaint(System.Drawing.Graphics G)
{
G.DrawLine(Pens.Lime, this.Bounds.Left, this.Bounds.Top + this.Bounds.Height / 2, this.Bounds.Right - 1, this.Bounds.Top + this.Bounds.Height / 2);
G.FillEllipse(Brushes.YellowGreen, this.Bounds.Left + (this.Value - this.MinValue) * this.Bounds.Width / (this.MaxValue - this.MinValue) - 10, this.Bounds.Top + (this.Bounds.Height - 10) / 2, 10, 10);
base.OnPaint(G);
}
示例8: Draw
/// <summary>
/// 绘制方法
/// </summary>
/// <param name="g"></param>
/// <param name="center"></param>
/// <param name="zoom"></param>
/// <param name="screen_size"></param>
public override void Draw(System.Drawing.Graphics g, LatLngPoint center, int zoom, System.Drawing.Size screen_size)
{
if (Points != null && Points.Count >= 2)
{
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
List<Point> l = new List<Point>();
foreach (LatLngPoint p in Points)
{
l.Add(MapHelper.GetScreenLocationByLatLng(p, center, zoom, screen_size)); //屏幕坐标
}
double total = 0; double step = 0;
using (Pen pen = new Pen(Color.FromArgb(150, Color.OrangeRed), 4))
{
for (int i = 0; i < l.Count - 1; ++i)
{
g.DrawLine(pen, l[i], l[i + 1]);
g.FillEllipse(Brushes.White, new Rectangle(new Point(l[i].X - 4, l[i].Y - 4), new Size(8, 8)));
g.DrawEllipse(Pens.OrangeRed, new Rectangle(new Point(l[i].X - 4, l[i].Y - 4), new Size(8, 8)));
if (i == 0) //起点
{
g.FillRectangle(Brushes.White, new Rectangle(l[i].X + 3, l[i].Y, 35, 20));
g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i].X + 3, l[i].Y, 35, 20));
g.DrawString("起点", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i].X + 6, l[i].Y + 2));
if (i == l.Count - 2) //终点 只有两点的时候
{
step = MapHelper.GetDistanceByLatLng(Points[i], Points[i + 1]);
total += step;
g.FillRectangle(Brushes.White, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 90, 20));
g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 90, 20));
g.DrawString("总长:" + Math.Round(total,2) + "公里", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i + 1].X + 10, l[i + 1].Y + 2));
}
}
else //其它点
{
step = MapHelper.GetDistanceByLatLng(Points[i-1], Points[i]);
total += step;
g.FillRectangle(Brushes.White, new Rectangle(l[i].X + 3, l[i].Y, 70, 20));
g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i].X + 3, l[i].Y, 70, 20));
g.DrawString(Math.Round(step,2) + "公里", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i].X + 10, l[i].Y + 2));
if (i == l.Count - 2) //终点
{
step = MapHelper.GetDistanceByLatLng(Points[i], Points[i + 1]);
total += step;
g.FillRectangle(Brushes.White, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 100, 20));
g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 100, 20));
g.DrawString("总长:" + Math.Round(total, 2) + "公里", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i + 1].X + 10, l[i + 1].Y + 2));
}
}
}
}
}
}
示例9: Draw
public override void Draw(System.Drawing.Graphics gr)
{
Brush brush = new SolidBrush(Color.Yellow);
gr.FillEllipse(brush, -radius, -radius, 2*radius, 2*radius);
foreach ( Planet p in planets )
p.Draw( gr );
}
示例10: Draw
public void Draw(System.Drawing.Graphics g)
{
if (Screen.PrimaryScreen.Bounds.Contains(currentFixationLocation))
{
int xPos = currentFixationLocation.X - DOTSIZE / 2;
int yPos = currentFixationLocation.Y - DOTSIZE / 2;
g.FillEllipse(Brushes.Gray, xPos, yPos, DOTSIZE, DOTSIZE);
}
}
示例11: Draw
public override void Draw(System.Drawing.Graphics g)
{
System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - RadiusX), (float)(Center.Y - RadiusY));
System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)(2 * RadiusX), (float)(2 * RadiusY));
System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
g.FillEllipse(solidBrush, rect);
solidBrush.Dispose();
}
示例12: DrawPoint
public void DrawPoint(System.Drawing.Graphics graphics)
{
if (FillStartPoint != null)
{
graphics.FillEllipse(FILL_START_POINT_COLOR,
FillStartPoint.X - FILL_START_POINT_RADIUS,
FillStartPoint.Y - FILL_START_POINT_RADIUS,
FILL_START_POINT_RADIUS * 2, FILL_START_POINT_RADIUS * 2);
}
}
示例13: DibujarElemento
public override void DibujarElemento(System.Drawing.Graphics grafico)
{
Pen p = new Pen(Color, 2);
p.StartCap = LineCap.Triangle;
int mitadX = _puerto.DimensionMundo.Centro.X;
int mitadY = _puerto.DimensionMundo.Centro.Y;
grafico.DrawLine(p, mitadX, mitadY, mitadX + 30, mitadY - 30);
grafico.FillEllipse(new SolidBrush(Color), mitadX + 20, mitadY - 30, 10, 10);
grafico.DrawString(Nombre, new Font("Arial", 8, FontStyle.Regular), Brushes.White, new PointF(mitadX + 30, mitadY - 30));
}
示例14: DibujarElemento
public override void DibujarElemento(System.Drawing.Graphics grafico)
{
Pen p = new Pen(Color, 2);
p.StartCap = LineCap.Triangle;
int mitadX = (_conexion.PosicionMundoPuerto1.X + _conexion.PosicionMundoPuerto2.X) / 2;
int mitadY = (_conexion.PosicionMundoPuerto1.Y + _conexion.PosicionMundoPuerto2.Y) / 2;
grafico.DrawLine(p, mitadX, mitadY, mitadX + 30, mitadY - 30);
grafico.FillEllipse(new SolidBrush(Color), mitadX + 20, mitadY - 30, 10, 10);
grafico.DrawString(Nombre, new Font("Arial", 8, FontStyle.Regular), Brushes.White, new PointF(mitadX + 30, mitadY - 30));
}
示例15: Draw
public override void Draw(System.Drawing.Graphics g, int panX, int panY)
{
int tempx1 = x1 - panX;
int tempx2 = x2 - panX;
int tempy1 = y1 - panY;
int tempy2 = y2 - panY;
if (needFilling)
g.FillEllipse(filling, tempx1, tempy1, tempx2 - tempx1, tempy2 - tempy1);
if (needOutline)
g.DrawEllipse(outline, tempx1, tempy1, tempx2 - tempx1, tempy2 - tempy1);
}