using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace drawGraphics
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Text = "Drawing a rectangle inscribed with circle";
this.Size = new Size(450, 400);
this.Paint += new PaintEventHandler(Draw_Graphics);
}
public void Draw_Graphics(object sender, PaintEventArgs e)
{
System.Drawing.Graphics g;
g = this.CreateGraphics();
Pen p1 = new Pen(System.Drawing.Color.Red, 3);
Pen p2 = new Pen(System.Drawing.Color.Blue,3);
Rectangle r = new Rectangle(100, 100, 50, 50);
g.DrawRectangle(p1, r);
g.DrawEllipse(p2, 100, 100, 50,50);
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
0 Comments