How to make a snowman in Visual Studio C# Windows Forms App (.NET Framework)?

  • Thread starter Thread starter student0289
  • Start date Start date
S

student0289

Guest
Hello!

So basically I need to create a snowman with geometric shapes, like circles ellipses and with white color.

The snowman need to be appear by clicking the Button in the (Form1 Design) interface. I have made a little progress but it is not done yet and also have a lot of error. Then I got stuck. Here is how far I have gone. Thanks in advance.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;



namespace Homework
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button_Click(object sender, EventArgs e)
{
void body(int x, int y)
void head(int x, int y, int r)

int x = 200;
int y = 100;
//It's body is ellipse
body(x, y);
head(x - 150, y - 50, 15);
ear(x - 150, y - 50, 10, 10);
}
void circle(int x, int y, int r)
{
Graphics g = this.CreateGraphics();
SolidBrush b = new SolidBrush(Color.Red);
g.FillEllipse(b, x - r, x - r, 2 * r, 2 * r);


{
Graphics g = this.CreateGraphics();
SolidBrush b = new SolidBrush(Color.Pink);
g.FillEllipse(b, x - r, y - r, 2 * r, 2 * r);
}

{
Graphics g = this.CreateGraphics();
SolidBrush b = new SolidBrush(Color.Pink);
g.FillEllipse(b, x - r, y - r, 2 * r, 2 * r);
}



}
void ear(int x, int y, int width, int height)
{
Graphics g = this.CreateGraphics();
GraphicsPath path = new GraphicsPath();
Point[] po = new Point[4];
po[0] = new Point(x, y);
po[1] = new Point( )


}

private void Form1_Load_1(object sender, EventArgs e)
{

}
}

}
}



Continue reading...
 
Back
Top