Hello everyone,
I am a beginner using C/C++. I am a Malaysia, Please forgive me if my English is bad.
Guys, I have a problem on coding undirected path graph using Window Form 2010. I don't know how do I need to write the code to draw the vertices and edge. So, I using circle together with line in order to form a path graph. Secondly, I also sucked on how to label every number on/in the vertices and edges.
private void panel2_Paint(object sender, PaintEventArgs e)
{
Graphics g=e.Graphics;
g.FillRectangle(Brushes.White, this.ClientRectangle);
GraphicsPath gp = new GraphicsPath();
gp.AddLine(27,15,125,15);
gp.AddLine(125,15,225,15);
gp.AddEllipse(new Rectangle(5, 5, 25, 25));
gp.AddEllipse(new Rectangle(110, 5, 25, 25));
gp.AddEllipse(new Rectangle(225, 5, 25, 25));
g.FillPath(Brushes.DeepSkyBlue, gp);
g.DrawPath(Pens.Black, gp);
gp.Dispose();
}
I know trhat this is totally a wrong concept. Can you guys please help me to solve this problem?
Please~~~~~~~~~~~~
** path graph is:
https://en.wikipedia.org/wiki/Path_graph