本文整理汇总了C#中System.Drawing.Drawing2D.GraphicsPath.AddEllipse方法的典型用法代码示例。如果您正苦于以下问题:C# System.Drawing.Drawing2D.GraphicsPath.AddEllipse方法的具体用法?C# System.Drawing.Drawing2D.GraphicsPath.AddEllipse怎么用?C# System.Drawing.Drawing2D.GraphicsPath.AddEllipse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Drawing2D.GraphicsPath
的用法示例。
在下文中一共展示了System.Drawing.Drawing2D.GraphicsPath.AddEllipse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frmLogin
public frmLogin()
{
InitializeComponent();
foreach (Button btn in this.Controls.OfType<Button>())
{//this will controll all button inside form
btn.FlatStyle = FlatStyle.Standard;
btn.ForeColor = Color.Black;
btn.BackColor = Color.White;
}
foreach (TextBox txtbox in this.Controls.OfType<TextBox>())
{//this will controll all textbox inside form
txtbox.BorderStyle = BorderStyle.None;
}
//background
this.BackgroundImage = Properties.Resources.bg;
this.BackgroundImageLayout = ImageLayout.Stretch;
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddEllipse(0, 0, pictureBox1.Width - 3, pictureBox1.Height - 3);
Region rg = new Region(gp);
pictureBox1.Region = rg;
}
示例2: btnCFD_Paint
//Chnage Facing Direction CFD
private void btnCFD_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new System.Drawing.Drawing2D.GraphicsPath();
myGraphicsPath.AddEllipse(new Rectangle(0, 0, 100, 100));
btnCFD.Size = new System.Drawing.Size(100, 100);
btnCFD.Region = new Region(myGraphicsPath);
}
示例3: Form1
public Form1()
{
InitializeComponent();
saveLogs("InitializeComponent");
cookies = ReadCookiesFromDisk("cookies.dat");
if ((!check()) && (Properties.Settings.Default.email != "") && (Properties.Settings.Default.password != ""))
{
if (!auth())
resultLabel.Text = "Error authentication";
}
Microsoft.Win32.RegistryKey readKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\ETS2MP");
if (readKey != null)
{
regInstallLocation = (string)readKey.GetValue("InstallLocation");
regInstallDir = (string)readKey.GetValue("InstallDir");
}
else
{
saveLogs("Game not found!");
}
System.Drawing.Drawing2D.GraphicsPath Button_Path = new System.Drawing.Drawing2D.GraphicsPath();
Button_Path.AddEllipse(0, 0, btnPlay.Width, btnPlay.Height);
System.Drawing.Region Button_Region = new System.Drawing.Region(Button_Path);
this.btnPlay.Region = Button_Region;
}
示例4: BBControl
public BBControl(int X, int Y, int dx, int dy)
{
InitializeComponent();
this.Location = new Point(X, Y);
Random rannd = new Random();
this.dx = dx;
this.dy = dy;
while (dy == 0)
{
this.dy = rannd.Next(-50, 50);
}
while (dx == 0)
{
this.dx = rannd.Next(-50, 50);
}
Color color = Color.FromArgb(rannd.Next(255), rannd.Next(255), rannd.Next(255));
while (color == Color.White)
{
color = Color.FromArgb(rannd.Next(255), rannd.Next(255), rannd.Next(255));
}
this.BackColor = color;
this.Width = 2 * rannd.Next(2, 25);
this.Height = this.Width;
System.Drawing.Drawing2D.GraphicsPath Button_Path = new System.Drawing.Drawing2D.GraphicsPath();
Button_Path.AddEllipse(0, 0, this.Width, this.Height);
Region Button_Region = new Region(Button_Path);
this.Region = Button_Region;
thread = new Thread(DoWork);
thread.Start();
}
示例5: frmLogginpass_Load
private void frmLogginpass_Load(object sender, EventArgs e)
{
lblUsuario.Text = nombreUser;
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddEllipse(0, 0, pbImgPerfil.Width - 3, pbImgPerfil.Height - 3);
Region rg = new Region(gp);
pbImgPerfil.Region = rg;
}
示例6: OnPaint
protected override void OnPaint(PaintEventArgs pevent)
{
this.Size = new Size(50, 50);
System.Drawing.Drawing2D.GraphicsPath aCircle = new System.Drawing.Drawing2D.GraphicsPath();
aCircle.AddEllipse(new System.Drawing.RectangleF(0, 0, 50, 50));
this.Region = new Region(aCircle);
base.OnPaint(pevent);
}
示例7: frmLogin_Load
private void frmLogin_Load(object sender, EventArgs e)
{
//Creating circle path
FillRoleCombo();
System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddEllipse(0, 0, 400, 400);
this.Region = new Region(path);
}
示例8: BBControl
public BBControl(int X, int Y, int dx, int dy, int width, int height)
{
InitializeComponent();
this.Location = new Point(X, Y);
this.dx = dx;
this.dy = dy;
this.BackColor = Color.Black;
this.Width = width;
this.Height = height;
System.Drawing.Drawing2D.GraphicsPath Button_Path = new System.Drawing.Drawing2D.GraphicsPath();
Button_Path.AddEllipse(0, 0, this.Width, this.Height);
Region Button_Region = new Region(Button_Path);
this.Region = Button_Region;
}
示例9: modifyFormDesign
private void modifyFormDesign() {
foreach (Button btn in this.Controls.OfType<Button>())
{//this will controll all button inside form
btn.FlatStyle = FlatStyle.Standard;
btn.ForeColor = Color.Black;
btn.BackColor = Color.White;
btn.Cursor = Cursors.Hand;
}
foreach (TextBox txtbox in this.Controls.OfType<TextBox>())
{//this will controll all textbox inside form
txtbox.BorderStyle = BorderStyle.None;
}
//background
this.BackgroundImage = Properties.Resources.bg;
this.BackgroundImageLayout = ImageLayout.Stretch;
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddEllipse(0, 0, pictureBox1.Width, pictureBox1.Height);
Region rg = new Region(gp);
//pictureBox1.Region = rg;
}
示例10: UpdateNodeGraphics
/// <summary>
/// aktualisiert das Feld nodeGraphics
/// </summary>
private void UpdateNodeGraphics()
{
if ((position != null) && (inSlope != null) && (outSlope != null))
{
// Linien zu den Stützpunkten
_nodeGraphics[0] = new System.Drawing.Drawing2D.GraphicsPath(new PointF[] { inSlopeAbs, position }, new byte[] { 1, 1 });
_nodeGraphics[1] = new System.Drawing.Drawing2D.GraphicsPath(new PointF[] { outSlopeAbs, position }, new byte[] { 1, 1 });
// Stützpunkte
System.Drawing.Drawing2D.GraphicsPath inPoint = new System.Drawing.Drawing2D.GraphicsPath();
inPoint.AddEllipse(inSlopeRect);
_nodeGraphics[2] = inPoint;
System.Drawing.Drawing2D.GraphicsPath outPoint = new System.Drawing.Drawing2D.GraphicsPath();
// wir versuchen ein Dreieck zu zeichnen *lol*
Vector2 dir = outSlope.Normalized;
outPoint.AddPolygon(
new PointF[] {
(6*dir) + outSlopeAbs,
(6*dir.RotateCounterClockwise(Math.PI * 2 / 3)) + outSlopeAbs,
(6*dir.RotateCounterClockwise(Math.PI * 4 / 3)) + outSlopeAbs,
(6*dir) + outSlopeAbs
});
_nodeGraphics[3] = outPoint;
}
}
示例11: OnPaint
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath shape = new System.Drawing.Drawing2D.GraphicsPath();
shape.AddEllipse(0, 0, this.Width, this.Height);
this.Region = new System.Drawing.Region(shape);
}
示例12: Node
// コンストラクタ
public Node(string value)
{
//値の設定
this.Value = value;
//コントロール(ノード)の設定
this.button = new System.Windows.Forms.Button();
this.button.Size = new Size(70, 70);
System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddEllipse(new Rectangle(10, 10, radius, radius));
this.button.Region = new Region(path);
this.button.BackColor = Color.White;
this.button.Text = value;
this.button.Font = new Font("Arial", 15, FontStyle.Bold);
//円の描写
Bitmap canvas = new Bitmap(this.button.Width, this.button.Height);
Pen p = new Pen(Color.Black, 5);
Graphics g = Graphics.FromImage(canvas);
g.DrawEllipse(p, 10, 10, 50, 50);
g.Dispose();
this.button.Image = canvas;
}
示例13: GeneratePath
protected override void GeneratePath()
{
_Path = new System.Drawing.Drawing2D.GraphicsPath();
_Path.AddEllipse(new Rectangle(this.Location, this.Size));
}
示例14: roundOver
public void roundOver(float playerCoordinateX, float playerCoordinateY, float radius, Graphics g, Rectangle ClientRectangle)
{
var circle = new System.Drawing.Drawing2D.GraphicsPath();
circle.AddEllipse(playerCoordinateX, playerCoordinateY, radius, radius);
g.SetClip(circle, System.Drawing.Drawing2D.CombineMode.Exclude);
Brush brush = new SolidBrush(Color.FromArgb(30, Color.Black));
g.FillRectangle(brush, 0, 0, currentView.backgroundImg.Width, currentView.backgroundImg.Height);
// Image gameover = Resourses.gameover;
// g.DrawImage(gameover, ClientRectangle, this.currentScene.backgroundImg.Width / 2, this.currentScene.backgroundImg.Height/ 2,gameover.Width,gameover.Height);
}
示例15: btnRename_Paint
//Rename Button
private void btnRename_Paint(object sender, PaintEventArgs e)
{
//Instantiate a new instance of the GraphicsPath class.
System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new
System.Drawing.Drawing2D.GraphicsPath();
myGraphicsPath.AddEllipse(new Rectangle(0, 0, 100, 100));
//Set the control's Region property to the instance
//of the GraphicsPath class you created above.
btnRename.Size = new System.Drawing.Size(100, 100);
btnRename.Region = new Region(myGraphicsPath);
}