本文整理汇总了C#中Graphics.FillEllipse方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics.FillEllipse方法的具体用法?C# Graphics.FillEllipse怎么用?C# Graphics.FillEllipse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphics
的用法示例。
在下文中一共展示了Graphics.FillEllipse方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
internal void Draw(Graphics graphics)
{
if(!Visible) return;
using(Brush brush=new SolidBrush(active ? ActiveColor : InactiveColor))
{
graphics.FillEllipse(brush, 0,0, 2*radius, 2*radius);
}
}
示例2: PaintNeuron
public void PaintNeuron(Graphics e)
{
e.FillEllipse(Brushes.Black, x - 6, y - 6, 12, 12);
}
示例3: PaintPulse
public void PaintPulse(Graphics e)
{
if ((pulsar_x != 0) && (pulsar_y != 0) && (pulsar_x != x2) && (pulsar_y != y2))
e.FillEllipse(Brushes.Red, pulsar_x - 3, pulsar_y - 3, 6, 6);
}
示例4: DrawNode
/// <summary>
/// Draws the node using GDI+.
/// </summary>
/// <param name="graphics">GDI+ Graphics surface.</param>
/// <param name="bounds">The bounds in which to draw the node.</param>
public override void DrawNode(Graphics graphics, Rectangle bounds) {
graphics.FillEllipse(mFill, bounds);
graphics.DrawEllipse(mStroke, bounds);
}
示例5: AddNoise
private void AddNoise(Graphics graphics1, Rectangle rect)
{
int num;
int num2;
switch (this._backgroundNoise)
{
case CaptchaImage.BackgroundNoiseLevel.None:
default:
return;
case CaptchaImage.BackgroundNoiseLevel.Low:
num = 30;
num2 = 40;
break;
case CaptchaImage.BackgroundNoiseLevel.Medium:
num = 18;
num2 = 40;
break;
case CaptchaImage.BackgroundNoiseLevel.High:
num = 16;
num2 = 39;
break;
case CaptchaImage.BackgroundNoiseLevel.Extreme:
num = 12;
num2 = 38;
break;
}
SolidBrush solidBrush = new SolidBrush(Color.Black);
int maxValue = Convert.ToInt32((double)Math.Max(rect.Width, rect.Height) / (double)num2);
int arg_89_0 = 0;
checked
{
int num3 = Convert.ToInt32((double)(rect.Width * rect.Height) / (double)num);
for (int i = arg_89_0; i <= num3; i++)
{
graphics1.FillEllipse(solidBrush, this._rand.Next(rect.Width), this._rand.Next(rect.Height), this._rand.Next(maxValue), this._rand.Next(maxValue));
}
solidBrush.Dispose();
}
}
示例6: Draw
//.........这里部分代码省略.........
}
}
else
{
if (((Automata)this).getInstruction(i, car).Contains(j))
{
CsTran += ((CsTran.Length == 0) ? (car.ToString()) : ("/" + car.ToString()));
}
}
}
else
foreach (Object MotObj in ((Gfa)this).Read)
{
string Mot = MotObj.ToString();
if (((Gfa)this).getInstruction(i, Mot).Contains(j))
{
CsTran += ((CsTran.Length == 0) ? (Mot.ToString()) : ("/" + Mot));
}
}
#region //DrawTransition(i, j, CsTran);
AdjustableArrowCap Fleche = new AdjustableArrowCap(5, 5, true);
Pen FlechePen = new Pen(Color.Red, 2);
FlechePen.CustomEndCap = Fleche;
if (CsTran.Length != 0) // il existe une transition de Si vers Sj
{
Point p1 = myPointArray[i];
Point p2 = myPointArray[j];
Point t1 = new Point();
Point t2 = new Point();
Point t3 = new Point();
Point t4 = new Point();
/*if (p2.X < p1.X)
{
t2.X = p1.X;
t1.X = p2.X + 30;
t3.X = t4.X = ((t1.X + t2.X) / 2) - (20 * i);
}
else {
t2.X = p1.X + 30;
t1.X = p2.X;
t3.X = t4.X = ((t1.X + t2.X) / 2) + (20 * i);
}
if (p2.Y < p1.Y)
{
t2.Y = p1.Y + 15;
t1.Y = p2.Y + 15;
t3.Y = t4.Y = ((t1.Y + t2.Y) / 2) - (20 * i);
}
else
{
t2.Y = p1.Y + 15;
t1.Y = p2.Y + 15;
t3.Y = t4.Y = ((t1.Y + t2.Y) / 2) + (20 * i);
}
Dessin.DrawBezier(FlechePen,t1,t3 ,t4,t2);
*/
if (p2 != p1)
{
Dessin.DrawBezier(FlechePen, p1.X + ((p1.X > p2.X) ? (0) : (30)), p1.Y + 10 + (2 * i), ((p2.X + p1.X) / 2), ((6 * p1.Y + p2.Y) / 7) - 40 + Ran.Next(80), (p2.X + p1.X) / 2, ((6 * p1.Y + p2.Y) / 7) - 40 + Ran.Next(80), p2.X + ((p1.X > p2.X) ? (30) : (0)), p2.Y + 10 + +(2 * i));
Dessin.DrawString(CsTran, myfont, pinceau, ((p2.X + p1.X) / 2), (4 * p1.Y + p2.Y) / 5);
grImage.DrawBezier(FlechePen, p1.X + ((p1.X > p2.X) ? (0) : (30)), p1.Y + 10 + (2 * i), ((p2.X + p1.X) / 2), ((6 * p1.Y + p2.Y) / 7) - 40 + Ran.Next(80), (p2.X + p1.X) / 2, ((6 * p1.Y + p2.Y) / 7) - 40 + Ran.Next(80), p2.X + ((p1.X > p2.X) ? (30) : (0)), p2.Y + 10 + +(2 * i));
grImage.DrawString(CsTran, myfont, pinceau, ((p2.X + p1.X) / 2), (4 * p1.Y + p2.Y) / 5);
}
else //Si -> Si
{
Dessin.DrawBezier(FlechePen, p1.X, p1.Y + 15, p1.X + 2, p1.Y + 60, p1.X + 25, p1.Y + 60, p1.X + 30, p1.Y + 15);
Dessin.DrawString(CsTran, myfont, pinceau, p1.X + 15, p1.Y + 30);
grImage.DrawBezier(FlechePen, p1.X, p1.Y + 15, p1.X + 2, p1.Y + 60, p1.X + 25, p1.Y + 60, p1.X + 30, p1.Y + 15);
grImage.DrawString(CsTran, myfont, pinceau, p1.X + 15, p1.Y + 30);
}
}
SolidBrush Fill = new SolidBrush(Color.White);
Dessin.FillEllipse(Fill, p.X + 3, p.Y + 3, 30 - 6, 30 - 6);
Dessin.DrawString("S" + i, myfont, pinceau, (p.X + 5), (p.Y + 8));
grImage.FillEllipse(Fill, p.X + 3, p.Y + 3, 30 - 6, 30 - 6);
grImage.DrawString("S" + i, myfont, pinceau, (p.X + 5), (p.Y + 8));
#endregion
}
}
//DrawPanel.Refresh();
}
示例7: switch
void IViewable.Redraw(Graphics g)
{
switch (state)
{
case State.Thinking:
{
pos = maxpos;
break;
}
case State.Eating:
{
pos = minpos;
break;
}
}
var radius = 10.0f + Convert.ToSingle(Math.Sqrt(helpings / Constants.ratio / Math.PI));
g.FillEllipse((state == State.Eating) ? Brushes.Green : Brushes.Red, -halfwidth, -pos - 2 * halfheight, radius, radius);
return;
}
示例8: Render
public override void Render(Graphics gr, int iScale)
{
gr.FillEllipse(new SolidBrush(m_Color), m_iXStart * iScale, m_iYStart * iScale, m_iWidth * iScale, m_iHeight * iScale);
if (m_iBorderThickness > 0)
gr.DrawEllipse(new Pen(m_BorderColor, m_iBorderThickness), m_iXStart * iScale, m_iYStart * iScale, m_iWidth * iScale, m_iHeight * iScale);
}
示例9: DrawMine
private void DrawMine(Rectangle drawArea, Graphics graphics)
{
SolidBrush blackBrush = new SolidBrush (Color.Black);
Rectangle ellipseRectangle = new Rectangle (
drawArea.X + drawArea.Width / 4,
drawArea.Y + drawArea.Height / 4,
drawArea.Width / 2,
drawArea.Height / 2
);
Pen minePen = new Pen (blackBrush);
minePen.Width = drawArea.Width / 10;
if (minePen.Width < 1)
{
minePen.Width = 1;
}
Point l1;
Point l2;
Point ellipseCentre = new Point (ellipseRectangle.X + ellipseRectangle.Width/2, ellipseRectangle.Y + ellipseRectangle.Height/2);
int prongLength = (ellipseRectangle.Width * 8) / 10;
for (int i = 0; i < 4; i++) {
double prongAngle = (((double)i) / 4) * Math.PI;
double sinVal = Math.Sin (prongAngle);
double cosVal = Math.Cos (prongAngle);
int l1X = ellipseCentre.X + (int)(sinVal * prongLength);
int l1Y = ellipseCentre.Y + (int)(cosVal * prongLength);
int l2X = ellipseCentre.X - (int)(sinVal * prongLength);
int l2Y = ellipseCentre.Y - (int)(cosVal * prongLength);
l1 = new Point (l1X, l1Y);
l2 = new Point (l2X, l2Y);
graphics.DrawLine (minePen, l1, l2);
}
graphics.FillEllipse (blackBrush, ellipseRectangle);
}
示例10: DrawPoint
private void DrawPoint(Graphics graphics, IPoint point, Brush brush, float dotSize)
{
point = _transform.ReverseTransform(point);
float x = Convert.ToSingle(point.Coordinate.X * _resolution);
float y = Convert.ToSingle(point.Coordinate.Y * _resolution);
graphics.FillEllipse(brush, x - dotSize / 2, y - dotSize / 2, dotSize, dotSize);
}
示例11: Draw
public void Draw(ref Graphics g, int R)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(this.color);
int i = (int)this.position.X; int j = (int)this.position.Y;
g.FillEllipse(myBrush, i - R, j - R, R * 2, R * 2);
myBrush.Dispose();
}
示例12: Draw
public override void Draw(Graphics g)
{
g.FillEllipse(Brushes.Red, location.X-radius,
location.Y-radius, 2*radius, 2*radius);
}
示例13: OnPaint
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
G = e.Graphics;
G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
G.Clear(BackColor);
G.SmoothingMode = SmoothingMode.AntiAlias;
GP1 = new GraphicsPath();
GP1.AddEllipse(0, 2, Height - 5, Height - 5);
PB1 = new PathGradientBrush(GP1);
PB1.CenterColor = Color.FromArgb(50, 50, 50);
PB1.SurroundColors = new Color[] { Color.FromArgb(45, 45, 45) };
PB1.FocusScales = new PointF(0.3f, 0.3f);
G.FillPath(PB1, GP1);
G.DrawEllipse(P1, 0, 2, Height - 5, Height - 5);
G.DrawEllipse(P2, 1, 3, Height - 7, Height - 7);
if (_Checked)
{
G.FillEllipse(Brushes.Black, 6, 8, Height - 15, Height - 15);
G.FillEllipse(Brushes.White, 5, 7, Height - 15, Height - 15);
}
SZ1 = G.MeasureString(Text, Font);
PT1 = new PointF(Height - 3, Height / 2 - SZ1.Height / 2);
G.DrawString(Text, Font, Brushes.Black, PT1.X + 1, PT1.Y + 1);
G.DrawString(Text, Font, Brushes.White, PT1);
}