Вы находитесь на странице: 1из 6

c 


   

cc 


c!  
 

y O 
private void Form1_Click(object sender, EventArgs e)
{
Graphics fg; //fg is the name of canvass
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,3); //3 is the width
fg.DrawLine(mypen,0,0, 80, 100); //end points
}






y „O 
private void Form1_Click(object sender, EventArgs e)
{
Graphics fg;
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,3);
fg.DrawRectangle(mypen, 20, 20, 60, 80); //co-
ordinates,width,height }


y O   O „O
private void Form1_Click(object sender, EventArgs e)
{
Graphics fg;
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,3);
fg.DrawLine(mypen, 20,20, 80, 100);
fg.DrawRectangle(mypen, 20, 20, 60, 80);
}




y  „O
private void Form1_Click(object sender, EventArgs e)
{
Graphics fg;
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,3);
fg.DrawEllipse(mypen, 30, 30, 50, 50);

}





y OO 
private void Form1_Click(object sender, EventArgs e)
{ Graphics fg;
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,3);
fg.DrawEllipse(mypen, 30, 30, 80, 40);
}



y  OO„OOO 
private void Form1_Click(object sender, EventArgs e)
{
Graphics fg;
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,3);
SolidBrush b = new SolidBrush(Color.Olive);//we
create solid brush for filling
fg.FillRectangle(b, 30, 30, 70, 30);
fg.FillEllipse(b, 60, 70, 60, 30);
}
 

 

y  O „ 
private void Form1_Click(object sender, EventArgs e)
{
Graphics fg;
fg = this.CreateGraphics();
SolidBrush b = new SolidBrush(Color.Olive);
fg.DrawString("anum", new Font("arial", 12), b, 50, 70);
}




„ 
private void Form1_Click(object sender, EventArgs e)
{
Graphics fg;
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,2);
SolidBrush b = new SolidBrush(Color.Olive);
fg.FillRectangle(b, 40, 20, 60, 40);
fg.DrawRectangle(mypen, 20, 40, 60, 40);
fg.DrawLine(mypen, 40, 20, 20, 40);
fg.DrawLine(mypen, 100, 20, 80, 40);
fg.DrawLine(mypen, 40, 60, 20, 80);
fg.DrawLine(mypen, 100, 60, 80, 80);

}



y -  „  
private void Form1_Click(object sender, EventArgs e)
{ Graphics fg;
fg = this.CreateGraphics();
Pen mypen = new Pen(Color.Magenta,2);
SolidBrush b = new SolidBrush(Color.Olive);
fg.DrawEllipse(mypen, 10, 40, 60, 30);
fg.DrawEllipse(mypen, 10, 120, 60, 30);
fg.DrawLine(mypen, 10, 55, 10, 135);
fg.DrawLine(mypen, 70, 55, 70, 135);
fg.DrawString("PEPSI", new Font("complex", 12), b, 10,80);
}