本文整理汇总了C#中System.Drawing.Graphics.FillEllipse方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics.FillEllipse方法的具体用法?C# Graphics.FillEllipse怎么用?C# Graphics.FillEllipse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.FillEllipse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RepertoryImage
public static void RepertoryImage(Graphics drawDestination)
{
StringFormat itemStringFormat = new StringFormat();
RectangleF itemBox = new RectangleF(10, 30, 42, 10);
RectangleF itemBox2 = new RectangleF(60, 48, 10, 10);
itemStringFormat.Alignment = StringAlignment.Center;
itemStringFormat.LineAlignment = StringAlignment.Far;
drawDestination.DrawLine(Pens.LightGray,10,10,10,70);
if (mMscStyle == MscStyle.SDL){
PointF[] capPolygon = new PointF[3];
capPolygon[0] = new PointF(61, 40);
capPolygon[1] = new PointF(53, 44);
capPolygon[2] = new PointF(53, 36);
drawDestination.FillPolygon(Brushes.Black,capPolygon);
drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat);
drawDestination.DrawLine(Pens.Black,10, 40, 60,40);
drawDestination.FillEllipse(Brushes.Black, new RectangleF(60,35, 10,10));
}
else if(mMscStyle == MscStyle.UML2){
drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat);
drawDestination.DrawLine(Pens.Black,10, 40, 60,40);
drawDestination.DrawLine(Pens.Black,60, 40, 54,43);
drawDestination.DrawLine(Pens.Black,60, 40, 54,37);
drawDestination.FillEllipse(Brushes.Black, new RectangleF(60,35, 10,10));
}
itemStringFormat.Dispose();
}
示例2: FillPill
public static void FillPill(Brush b, RectangleF rect, Graphics g)
{
if (rect.Width > rect.Height)
{
g.SmoothingMode = SmoothingMode.HighQuality;
g.FillEllipse(b, new RectangleF(rect.Left, rect.Top, rect.Height, rect.Height));
g.FillEllipse(b, new RectangleF(rect.Left + rect.Width - rect.Height, rect.Top, rect.Height, rect.Height));
var w = rect.Width - rect.Height;
var l = rect.Left + ((rect.Height) / 2);
g.FillRectangle(b, new RectangleF(l, rect.Top, w, rect.Height));
g.SmoothingMode = SmoothingMode.Default;
}
else if (rect.Width < rect.Height)
{
g.SmoothingMode = SmoothingMode.HighQuality;
g.FillEllipse(b, new RectangleF(rect.Left, rect.Top, rect.Width, rect.Width));
g.FillEllipse(b, new RectangleF(rect.Left, rect.Top + rect.Height - rect.Width, rect.Width, rect.Width));
var t = rect.Top + (rect.Width / 2);
var h = rect.Height - rect.Width;
g.FillRectangle(b, new RectangleF(rect.Left, t, rect.Width, h));
g.SmoothingMode = SmoothingMode.Default;
}
else if (rect.Width == rect.Height)
{
g.SmoothingMode = SmoothingMode.HighQuality;
g.FillEllipse(b, rect);
g.SmoothingMode = SmoothingMode.Default;
}
}
示例3: Draw
public void Draw(Graphics g, Size mapSize)
{
bool drawSquares = false;
var galaxyMap = GalaxyMap.Instance;
var galaxy = galaxyMap.Galaxy;
var faction = galaxy.GetFaction(Planet);
var color = faction != null ? faction.Color : Color.White;
using (var brush = new SolidBrush(color)) {
var x1 = (int)(Position.X*mapSize.Width - PlanetSize/2);
var y1 = (int)(Position.Y*mapSize.Height - PlanetSize/2);
g.FillEllipse(Brushes.Black, x1 - OutlineSize, y1 - OutlineSize, PlanetSize + OutlineSize * 2, PlanetSize + OutlineSize * 2);
g.FillEllipse(brush, x1, y1, PlanetSize, PlanetSize);
if (drawSquares) {
g.SmoothingMode = SmoothingMode.None;
g.InterpolationMode = InterpolationMode.NearestNeighbor;
Faction attackFaction;
var found = galaxyMap.AttackablePlanetIDs.TryGetValue(Planet.ID, out attackFaction);
if (found) {
g.DrawRectangle(new Pen(attackFaction.Color, 3), x1, y1, PlanetSize, PlanetSize);
}
if (galaxyMap.ClaimablePlanetIDs.Contains(Planet.ID)) {
g.DrawRectangle(new Pen(Color.Purple, 3), x1, y1, PlanetSize, PlanetSize);
}
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
}
}
}
示例4: Draw
public override void Draw(Graphics aGfx,int alWorldX,int alWorldY ,eEditMode mMode, bool abSelected)
{
Color Col;
if(mMode == eEditMode.Lights)
{
Col = abSelected?Color.FromArgb(80,255,80):Color.FromArgb(255,0,255);
SolidBrush CenterBrush = new SolidBrush(Col);
aGfx.FillEllipse(CenterBrush,mlX-10-alWorldX,mlY-10-alWorldY,
20,20);
CenterBrush.Dispose();
}
else
{
Col = Color.Gray;
SolidBrush CenterBrush = new SolidBrush(Col);
aGfx.FillEllipse(CenterBrush,mlX-3-alWorldX,mlY-3-alWorldY,
6,6);
CenterBrush.Dispose();
}
Pen OuterPen = new Pen(Col);
aGfx.DrawEllipse(OuterPen,mlX-mfRadius-alWorldX,mlY-mfRadius-alWorldY,
mfRadius*2,mfRadius*2);
OuterPen.Dispose();
}
示例5: DrawBreakpoint
/// <summary>
/// Draws a breakpoint icon in the margin.
/// </summary>
/// <param name="g">The <see cref="Graphics"/> context.</param>
/// <param name="rectangle">The bounding rectangle.</param>
/// <param name="isEnabled"><c>true</c> if enabled..</param>
/// <param name="willBeHit"><c>true</c> if it will be hit.</param>
public static void DrawBreakpoint(Graphics g, Rectangle rectangle, bool isEnabled, bool willBeHit)
{
int diameter = Math.Min(rectangle.Width - 4, rectangle.Height);
Rectangle rect = new Rectangle(2, rectangle.Y + (rectangle.Height - diameter) / 2, diameter, diameter);
using (GraphicsPath path = new GraphicsPath())
{
path.AddEllipse(rect);
using (PathGradientBrush pthGrBrush = new PathGradientBrush(path))
{
pthGrBrush.CenterPoint = new PointF(rect.Left + rect.Width / 3, rect.Top + rect.Height / 3);
pthGrBrush.CenterColor = Color.MistyRose;
Color[] colors = { willBeHit ? Color.Firebrick : Color.Olive };
pthGrBrush.SurroundColors = colors;
if (isEnabled)
{
g.FillEllipse(pthGrBrush, rect);
}
else
{
g.FillEllipse(SystemBrushes.Control, rect);
using (Pen pen = new Pen(pthGrBrush))
{
g.DrawEllipse(pen, new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2));
}
}
}
}
}
示例6: Render
internal override void Render(Graphics graphics, SizeF minimumSize, PointF location)
{
var size = Measure(graphics);
size.Width = Math.Max(minimumSize.Width, size.Width);
size.Height = Math.Max(minimumSize.Height, size.Height);
Brush incomingSignalColor = Brushes.LightSteelBlue;
Brush ownSignalColor = Brushes.LightSteelBlue;
if (m_signal.IsIncomingRised())
{
incomingSignalColor = Brushes.LimeGreen;
}
if (m_signal.IsDropped())
{
ownSignalColor = Brushes.Tomato;
}
if (m_signal.IsRised())
{
ownSignalColor = Brushes.LimeGreen;
}
graphics.FillEllipse(incomingSignalColor, location.X + SIGNAL_OFFSET, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);
graphics.DrawEllipse(Pens.DimGray, location.X + SIGNAL_OFFSET, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);
graphics.FillEllipse(ownSignalColor, location.X + 2 * SIGNAL_OFFSET + SIGNAL_SIZE, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);
graphics.DrawEllipse(Pens.DimGray, location.X + 2 * SIGNAL_OFFSET + SIGNAL_SIZE, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);
graphics.DrawString(this.Text, SystemFonts.MenuFont, Brushes.Black, new RectangleF(location, size), GraphConstants.RightTextStringFormat);
}
示例7: DrawTabButtonContent
/// <summary>
/// Overridden. Draws the content of the QTabButton button, here the extra CloseButton is painted.
/// </summary>
protected override void DrawTabButtonContent(QTabButton button, QTabButtonConfiguration buttonConfiguration, string text, Icon icon, Color replaceColor, Color replaceColorWith, Color textColor, Font font, Rectangle bounds, Graphics graphics)
{
//First call the base.
base.DrawTabButtonContent(button, buttonConfiguration, text, icon, replaceColor, replaceColorWith, textColor, font, bounds, graphics);
//Get the QTabCloseButton.
QTabCloseButton tmp_oButton = button.Control.Tag as QTabCloseButton;
if (tmp_oButton != null)
{
//Set the bounds.
tmp_oButton.Bounds = new Rectangle(bounds.Right + 2, bounds.Top + 3, 10, 11);
//Determine its state and draw an Ellipse and a Cross image.
if ((tmp_oButton.IsPressed) && (tmp_oButton.IsHot))
{
graphics.FillEllipse(Brushes.DarkRed, new QPadding(2, 2, 1, 1).InflateRectangleWithPadding(tmp_oButton.Bounds, true, true));
QControlPaint.DrawImage(QTabCloseButton.CloseMask, Color.Red, Color.White, QImageAlign.Centered, tmp_oButton.Bounds, QTabCloseButton.CloseMask.Size, graphics);
}
else if (tmp_oButton.IsHot)
{
graphics.FillEllipse(Brushes.Red, new QPadding(2,2,1,1).InflateRectangleWithPadding(tmp_oButton.Bounds, true, true));
QControlPaint.DrawImage(QTabCloseButton.CloseMask, Color.Red, Color.White, QImageAlign.Centered, tmp_oButton.Bounds, QTabCloseButton.CloseMask.Size, graphics);
}
else
{
QControlPaint.DrawImage(QTabCloseButton.CloseMask, Color.Red, Color.FromArgb(50,50,50), QImageAlign.Centered, tmp_oButton.Bounds, QTabCloseButton.CloseMask.Size, graphics);
}
}
}
示例8: Draw
public override void Draw(Graphics g)
{
RectangleF rect = rectComponent.TopLeftCorner.CloneAndAdd(0, offSet).MakeRectangleFTill(rectComponent.BottomRightCorner.CloneAndAdd(0, -offSet));
RectangleF upperRect = rectComponent.TopLeftCorner.MakeRectangleFTill(rectComponent.TopLeftCorner.CloneAndAdd(rectComponent.Width, 2 * offSet));
RectangleF lowerRect = rectComponent.BottomRightCorner.CloneAndAdd(-rectComponent.Width, -2 * offSet).MakeRectangleFTill(rectComponent.BottomRightCorner);
using (LinearGradientBrush brush =
new LinearGradientBrush(rect, ViewFactory.GradStartColor, ViewFactory.GradEndColor, 90.0f))
{
g.FillRectangle(brush, rect);
g.DrawRectangle(ViewFactory.BorderPen, rect.X, rect.Y, rect.Width, rect.Height);
}
using (LinearGradientBrush brush =
new LinearGradientBrush(upperRect, ViewFactory.GradStartColor, ViewFactory.GradEndColor, 90.0f))
{
g.FillEllipse(brush, upperRect);
g.DrawEllipse(ViewFactory.BorderPen, upperRect.X, upperRect.Y, upperRect.Width, upperRect.Height);
}
using (LinearGradientBrush brush =
new LinearGradientBrush(lowerRect, ViewFactory.GradStartColor, ViewFactory.GradEndColor, 90.0f))
{
g.FillEllipse(brush, lowerRect);
g.DrawArc(ViewFactory.BorderPen, lowerRect, 0, 180);
}
base.Draw(g);
}
示例9: drawnShap
public override void drawnShap(Graphics pe)
{
Brush CurrentBrush = initBrush();
if (this.State.Shift1 == true)
{
calcShift();
findSecondPointWhenShift();
pe.DrawEllipse(new Pen(State.CurrentColor, State.LineWidth), State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Width1);
if (State.IsBrushFill == true)
{
pe.FillEllipse(CurrentBrush, State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Width1);
}
}
else
{
calcHeightWidth();
pe.DrawEllipse(new Pen(State.CurrentColor, State.LineWidth), State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Height1);
if (State.IsBrushFill == true)
{
pe.FillEllipse(CurrentBrush, State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Height1);
}
}
}
示例10: RepertoryImage
public static void RepertoryImage(Graphics drawDestination)
{
StringFormat itemStringFormat = new StringFormat();
RectangleF itemBox = new RectangleF(15, 30, 50, 20);
itemStringFormat.Alignment = StringAlignment.Center;
itemStringFormat.LineAlignment = StringAlignment.Center;
drawDestination.DrawLine(Pens.LightGray,40,10,40,70);
if (mMscStyle == MscStyle.SDL){
PointF[] statePolygon = new PointF[6];
statePolygon[0] = new PointF(5,40);
statePolygon[1] = new PointF(15,30);
statePolygon[2] = new PointF(65,30);
statePolygon[3] = new PointF(75,40);
statePolygon[4] = new PointF(65,50);
statePolygon[5] = new PointF(15,50);
drawDestination.FillPolygon(Brushes.White,statePolygon);
drawDestination.DrawString("State",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
drawDestination.DrawPolygon(Pens.Black,statePolygon);
}
else if(mMscStyle == MscStyle.UML2){
drawDestination.FillRectangle(Brushes.White,itemBox);
drawDestination.FillEllipse(Brushes.White,5,30,20,20);
drawDestination.FillEllipse(Brushes.White,55,30,20,20);
drawDestination.DrawLine(Pens.Black,15,30,65,30);
drawDestination.DrawLine(Pens.Black,15,50,65,50);
drawDestination.DrawArc(Pens.Black,5,30,20,20,90,180);
drawDestination.DrawArc(Pens.Black,55,30,20,20,270,180);
drawDestination.DrawString("State",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
}
itemStringFormat.Dispose();
}
示例11: DrawEdge
/// <summary>
/// Draw a Vertex
/// </summary>
public static void DrawEdge(Graphics g, IEdge e, PointF pSource, PointF pTarget, bool highLight = false)
{
var ps = pSource;
var pt = pTarget;
g.DrawLine(highLight ? penHighLight : penEdge, ps, pt);
g.FillEllipse(highLight ? brushHighLight : brushEdgePoint, (pt.X + ps.X) / 2 - 2, (pt.Y + ps.Y) / 2 - 2, 4, 4);
g.FillEllipse(highLight ? brushHighLight : brushEdgePoint, (pt.X * 2 + 3 * ps.X) / 5 - 4, (pt.Y * 2 + ps.Y * 3) / 5 - 4, 8, 8);
}
示例12: Draw
public override void Draw(Graphics g, string str)
{
switch(str)
{
case "XY": g.FillEllipse(new SolidBrush(Color.Black), _x, g.VisibleClipBounds.Height - _y, 6, 6); break;
case "XZ": g.FillEllipse(new SolidBrush(Color.Black), _x, g.VisibleClipBounds.Height - _z, 6, 6); break;
case "YZ": g.FillEllipse(new SolidBrush(Color.Black), _y, g.VisibleClipBounds.Height - _z, 6, 6); break;
default: break;
}
}
示例13: draw
public void draw(Graphics g)
{
Pen p = new Pen(Brushes.Black, 3);
g.DrawLine(p, new Point( Width / 2-1,0),new Point( Width / 2-1,Height));
g.DrawLine(p, new Point(0, Height/2-1), new Point(Width, Height/2-1));
if (hasCheck==1)
g.FillEllipse(Brushes.Black, new Rectangle(0, 0, 25, 25));
else if(hasCheck==2)
g.FillEllipse(Brushes.White, new Rectangle(0, 0, 25, 25));
}
示例14: DrawRoundRect
private void DrawRoundRect(Graphics g, Brush br, Rectangle area)
{
int rd = 8;
g.FillEllipse(br, area.X, area.Y, rd * 2, rd * 2);
g.FillEllipse(br, area.X, area.Y + area.Height - rd * 2, rd * 2, rd * 2);
g.FillEllipse(br, area.X + area.Width - rd * 2, area.Y, rd * 2, rd * 2);
g.FillEllipse(br, area.X + area.Width - rd * 2, area.Y + area.Height - rd * 2, rd * 2, rd * 2);
g.FillRectangle(br, area.X , area.Y + rd, area.Width+1, area.Height - rd*2);
g.FillRectangle(br, area.X + rd, area.Y, area.Width - rd * 2, area.Height+1);
}
示例15: Draw
public void Draw(Graphics g)
{
float r = this.r / 4;
float d = (float)Math.Sqrt(this.vx * this.vx + this.vy * this.vy);
if (d != 0.0f) {
float vx = this.vx / d;
float vy = this.vy / d;
float vx_ = vy;
float vy_ = -vx;
PointF[] points = new PointF[3];
points[0] = new PointF(this.px + this.r * vx_, this.py + this.r * vy_);
points[1] = new PointF(this.px + 3 * this.r / 2 * vx, this.py + 3 * this.r / 2 * vy);
points[2] = new PointF(this.px - this.r * vx_, this.py - this.r * vy_);
Brush brush = new SolidBrush(Color.FromArgb(150, Color.Blue));
g.FillPolygon(brush, points);
float x;
float y;
float rFoot = this.r - r / 2;
float rHand = 2 * r;
float koef = (float)Math.Sin(this.t / rFoot * (float)Math.PI);
float dFoot = rFoot * koef;
float dHand = rHand * koef;
x = this.px + vx_ * (this.r - r) + dHand * vx;
y = this.py + vy_ * (this.r - r) + dHand * vy;
g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);
x = this.px + vx_ * r - dFoot * vx;
y = this.py + vy_ * r - dFoot * vy;
g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);
x = this.px - vx_ * (this.r - r) - dHand * vx;
y = this.py - vy_ * (this.r - r) - dHand * vy;
g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);
x = this.px - vx_ * r + dFoot * vx;
y = this.py - vy_ * r + dFoot * vy;
g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);
this.t += d;
} else {
this.t = 0.0f;
}
g.FillEllipse(this.brush, this.px - this.r, this.py - this.r, 2 * this.r, 2 * this.r);
g.DrawEllipse(this.pen, this.px - this.r, this.py - this.r, 2 * this.r, 2 * this.r);
}